GO-29 Help

GO-29
SciRPN
Pocket Calculator
 

GO-29 SciRPN closely simulates the venerable HP-29C Programmable Pocket Scientific Calculator. The HP-29C was released in 1977 and sold for a MSRP of $195. Virtually indistinguishable from the real item in operation, GO-29 is a powerful yet simple retro calculator.

Topics

Prologue

Capabilities At A Glance
  • RPN (Reverse Polish Notation)
  • Four stack registers
  • Thirty storage registers
    • 10 primary registers
    •  6 statistical registers
    • 14 indirect registers
  • Math, trigonometric, polar/rectangular, logarithmic, statistical, power functions
  • Copy and paste
  • Programmable, with subroutines, branching, indirect addressing, annotated program listing, and memory for 198 program steps
  • Fast, slow or single step program execution
  • Four additional windows for stack/storage registers, keystroke log, program source code and program documentation
  • Program import via pasteboard or from other Apps
  • Program export via printer, email, pasteboard or to others Apps

Topics

Introduction

This document is not an exhaustive reference manual; rather, it's a terse outline of the calculator's function and programming keys. I have structured this information so that prerequisite material generally comes first, thus, you are encouraged to read the topics sequentially.

In this document normal calculator keys are shown in bold, such as +, or CHS, or 4, or Σ+. Most keys can perform two other functions, however, one labeled in blue and and one labeled in gold. To execute one of these functions you first touch the corresponding colored prefix key, either g or f, followed by the desired function key.

So to compute the sine of a number you'd touch two keys, the f prefix key followed by the 4 key. However, this document will simply show the key as sin: the font color implies which prefix character is used. Similarly, touching the two keys g and 4 executes the arcsine function sin-1. The only exception to this convention is when discussing programming and keycodes.

The PRGM-RUN switch controls the two basic calculator modes. In RUN mode, key presses are executed immediately and results are shown in the calculator display area. In PRGM mode, key presses are stored in program memory for later execution. It's important to realize which mode the calculator is in, as it has ramifications that affect other operational characteristics of the device.

(As you'll learn later there are two variants of RUN mode, for three actual calculator modes.)

Topics

Manual Problem Solving

To get the feel of your new calculator, try a few simple calculations. First, perform these operations:

  • Set the ON-OFF switch to ON.
  • Set the PRGM-RUN switch to RUN.
  • Press Q 2 so the display will match the examples.

To calculate the surface area of a sphere, the formula `A_(surface)=pid^2` can use used, where d is the diameter of the sphere. Ganymede, one of Jupiter's 12 moons, has a diameter of 3,200 miles. You can use the calculator to manually compute the area of Ganymede in square miles. Merely press the following keys in order:

PressDisplay
32003200.
!10240000.00
%3.14
?32169908.78
Programmed Problem Solving

After calculating the surface area of Ganymede, one of Jupiter's 12 moons, suppose you decided you wanted the surface area of each moon. You could repeat the procedure you used for Ganymede 12 times, using a different diameter d each time; however, an easier and faster method is to create a program that will calculate the surface area of any sphere from its diameter rather than pressing all the keys for each moon.

To calculate the area of a sphere using a program, you should first write the program, then you must load the program into the calculator, and finally you run the program to calculate each answer.

Writing the Program. You have already written it! A program is nothing more than the series of keystrokes you would execute to solve the same problem manually . Two additional operations, a label and a return are used to define the beginning and end of the program.

Loading the Program. To load the keystrokes of the program into the calculator:

  • Slide the PRGM-RUN switch to PRGM.
  • Press _X to clear the calculator.
  • Press these keys in order. (When you are loading a program, the display gives you information that you will find useful later, but which you can ignore for now.)

© 0
!
%
?
§

The calculator will now remember this keystroke sequence.

Running the Program. To run the program to find the area of any sphere from its diameter:

  • Slide the PRGM-RUN switch to RUN.
  • Key in the value of the diameter.
  • Press ¦ 0 to run the program.

When you press ¦ 0, the sequence of keystrokes you loaded is automatically executed by the calculator, giving you the same answer you would have obtained manually. So now, in short order, you can calulate the surface areas of Io (2310 miles), Europa (1950 miles) and Callisto (3220 miles):

PressDisplay
2310 ¦ 016763852.56
1950 ¦ 011945906.07
3220 ¦ 032573289.27

Part I - Manual Usage

GO-29 Calculator Display

The GO-29 LED window acts as a display area, as well as a touch sensitive input area that initiates further activities not available on an actual HP-29C. The calculator display is also modal, so what it displays and how it reacts to a single-tap on the display depends on the setting of the PRGM-RUN switch.

RUN Mode

In RUN mode the display shows the X stack register, usually the result of the latest calculation. Tapping the display in RUN mode brings up the Copy / Paste menu, allowing you to export the value of X, or import a new value of X.

In GO-29, numbers in the display normally appear rounded to only two decimal places. For example, the fixed constant π, which is actually in the calculator as 3.14159265358979, normally appears in the display as 3.14 (unless you tell the calculator to show you the number rounded to a greater or lesser number of decimal places).

Although a number is normally shown to only two decimal places, GO-29 always computes internally using each number as a 14-digit mantissa and a two-digit exponent of 10.

Three keys control how numbers are displayed. FIX allows numbers to be displayed in fixed decimal point format, SCI displays numbers in scientific notation format, and ENG displays numbers in engineering notation, with exponents of 10 shown in multiples of three (e.g., 103, 10-6, 1012) . Display control alters only the manner in which a number is displayed, the actual number itself is not altered by any of the display control keys.

To select a display mode press one of the display mode keys followed by a number key to specify the number of decimal places (0-9) to which the display is to be rounded.

The calculator switches the display from fixed point notation to scientific notation with the same number of decimal places as previously set by FIX whenever the number is too large or too small to be seen with a fixed decimal point. This feature keeps you from missing unexpectedly large or small answers.

You can key in numbers multiplied by powers of 10 by pressing EEX (enter exponent of ten). You can save time when keying in exact powers of 10 by merely pressing EEX and then pressing the desired power of 10. To key in negative exponents of 10, key in the number, press EEX, press CHS to make the exponent negative, then key in the power of 10.

When a number is greater than 9.9999999 x 1099 an overflow has occurred and 9.9999999+99 is displayed instead. Other illegal operations, such as a divide by zero, display the word Error, then set the illegal number to zero.

Also, there is a GO-29 settings called Commify Numbers that adds a comma thousands separator to the display, usefull as an assist in reading long numbers.

PRGM Mode

In PRGM mode the calculator display shows the current program step. The left-most two digits are the actual program step number, and the remaining digits represent the step's instruction opcodes, fully described in the section GO-29 Keycodes. It's this mode that allows you to manually enter a program into the calculator, just like an authentic HP-29C. Tapping the display in PRGM mode brings up the Import PRGM / Share PRGM menu, allowing you to transfer GO-29 programs to / from the App.

Topics

The Stack

Automatic storage of intermediate results is the reason that GO-29 slides so easily through the most complex equations. The displayed X register, which is the only visible register in the calculator display, is one of four registers inside the calculator that are positioned to form the automatic memory stack. We label these registers X, Y, Z, and T. They are "stacked" one on top of the other with the displayed X register on the bottom and T at the top.

T

4.00

Z

3.00

Y

2.00

X

1.00

Automatic Memory Stack
Manipulating Stack Contents

The s (roll down) and a (X exchange Y) keys allow you to review the stack contents or to shift data within the stack for computation at any time. Each time you press the s key the stack contents shift downward one register, with the contents of X rotating up to the T register. Notice that the contents of the registers are shifted - the registers themselves maintain their positions. Always remember, though, that it takes four presses of the s key to return the contents to their original registers.

The a key exchanges the contents of the X and Y registers without affecting the Z and T registers.

The z key lifts the stack, by copying the contents of Z into T, Y into Z, X into Y, hence losing the contents of T and duplicating the contents of X.

The opposite of lifting the stack is called dropping the stack. When the stack drops, Y is copied to X, Z is copied to Y, and T is copied to Z, hence losing the contents of X and duplicating the contents of T.

To clear the displayed X register only, press CLX. Any new number then writes over the zero in X. To clear the entire stack press CLX followed by z three times.

Functions and the Stack

One-number functions such as m execute upon the number in the X-register only, and the answer writes over that number. No other stack registers are affected by executing a one-number function.

Two-number functions such as p, or arithmetic operations such as /, execute upon two stack registers, X and Y. Obviously, for the power function first enter the base followed by z to lift it into Y, then enter the power into X and press p to perform the function.

For arithmetic operations imagine the stack as an old-fashioned sheet of paper, where in the case of division, the divedend (Y) is written on top of the divisor (X), then the / operation is executed. Addition, subtraction and muliplication work the same way, both numbers are positioned in the stack in the natural order, there are no exceptions to this rule.

You can use s and a as required to re-order the operands. In all cases after the function or operation is executed the stack drops and the answer is written over X (the old Y before the stack drop).

Topics

Storage Registers

In addition to the automatic storage of intermediate results that is provided by the four-register automatic memory stack, the calculator also has 30 addressable data storage registers that are unaffected by operations within the stack. These storage registers allow you to manually store and recall constants or to set aside numbers for use in later calculations. Like all functions, you can use these storage registers either from the keyboard or as part of a program. All 30 storage registers reside contiguously in Continuous Memory and maintain their contents even when the calculator is turned OFF.

The diagram below shows all storage registers. The addresses of the primary storage registers are indicated by the numbers 0 through 9 and by .0 through .5. The addresses of the indirect storage registers are indicated by the numbers (16) through (29). Storing and recalling numbers in the 14 indirect storage registers is explained in section Using the R₀ Register for Indirect Control.

Primary

Indirect

R₀

R₍₁₆₎

R₁

R₍₁₇₎

R₂

R₍₁₈₎

R₃

R₍₁₉₎

R₄

R₍₂₀₎

R₅

R₍₂₁₎

R₆

R₍₂₂₎

R₇

R₍₂₃₎

R₈

R₍₂₄₎

R₉

R₍₂₅₎

R.₀

R₍₂₆₎

R.₁

R₍₂₇₎

R.₂

R₍₂₈₎

R.₃

R₍₂₉₎

R.₄


R.₅


Storage Registers
Manipulating Storage Registers
  • Store
    To store the X value appearing in the display into any of the storage registers R₀ through R₉, press STO followed by a number key 0 through 9 specifying the register address where the value is to be stored. To store X into any of the storage registers R.₀ through R.₅, press STO followed by the decimal point key . followed by the number key of the applicable register address 0 through 5. When a number is stored, it is merely copied into the primary storage register, and remains in the displayed X register.
  • Recall
    Numbers are recalled from one of the sixteen primary storage registers back into the displayed X register in much the same way as they are stored. Press the RCL key followed by:
    • either the register number key 0 through 9.
    • or the decimal point . then the register number key 0 through 5.

    Recalling a number causes the stack to lift unless the preceding keystroke was z, v or g.

    When you recall a number, it is copied from the storage register into X, and it also remains in the storage register. You can recall a number from a storage register any number of times without altering it; the number will remain in the storage register until you overwrite it by storing another number there, or until you clear the storage registers.
  • Clear
    To clear the number from a single storage register, simply store the quantity zero in the register by pressing 0 STO followed by the register number 0 through 9 or .0 through .5. To clear data from all manual storage registers at once, without affecting data in other portions of the calculator, press _C. This places zero in all thirty of the storage registers. You can also clear storage registers R.₀ through R.₅ while leaving the remaining storage registers and the stack intact by using the _¥function.

    Remember that because of the Continuous Memory of the calculator the primary storage registers retain their contents even though the calculator is turned OFF.

Storage Register Arithmetic

Arithmetic is performed upon the contents of a primary storage register by pressing STO, followed by the arithmetic function key, followed in turn by the register address R₀ through R.₅.

  • STO + 1 (Contents of storage register R₁ plus X, and sum placed into R₁.)
  • STO - 2 (Contents of storage register R₂ minus X, and difference placed into R₂.)
  • STO x . 3 (Contents of storage register R.₃ multiplied X, and product placed into R.₃.)
  • STO ÷ . 4 (Contents of storage register R.₄ divided by X, and quotient placed into R.₄.)

When storage register arithmetic operations are performed, the answer is written into the selected storage register, while the contents of the displayed X register and the rest of the stack remain unchanged.

If the magnitude of a number in any of the storage registers exceeds 9.999999999 x 1099, the display immediately shows Error (overflow) to indicate that a storage register has overflowed.

When you then press any key, the error condition is cleared and the last value in the X register before the error is again displayed. The storage registers all contain the values they held before the error-causing operation was attempted.

Topics

GO-29 Auxiliary Information Views

GO-29 provides two distinct, scrollable, views of the calculator's internal state unavailable on the real hardware. This makes using the calculator, and programming and debugging code much easier. Access to this additional information is controlled by a double-tap on the calculator display. If the information view is visible, a double-tap hides the view. If the view is not visible, the information view appears. So a double-tap of the calculator display toggles the visibility of the available auxiliary information.

Similar to single-tapping the calculator display, the information that's displayed in response to a double-tap is dependent on the setting of the PRGM-RUN switch.

(Note: unlike for iPhone and iPod touch, which have tiny screens, on iPad both information views are by default always visible, but you can hide them with two double-taps, if desired, one in PRGM mode and one in RUN mode.)

Both auxiliary information views include this touch point that toggles what the view shows, detailed in the following two sections.

RUN Mode

In RUN mode the 4 stack registers, the 30 storage registers, and the Y register are displayed in the scrollable stack and register window. Touching the switch-views control transitions to the paper tape window and shows up to 100 lines of RUN mode key-press history to help you make sense of the values you see in the stack-register window.

PRGM Mode

In PRGM mode the program listing is shown. The listing displays the program name and description, and the step numbers, opcodes and pneumonics for all program steps. Both the program listing and program description are scrollable and editable.

The current step pointer (SP) is highlighted by a right pointing double arrow. In RUN mode this is the next instruction to be executed via SST or R/S. In PRGM mode you edit the step following the SP. More on this in the programming sections of these notes.

In PRGM mode you can also move the arrow pointer to any step by just touching the step. If you touch and hold a program listing step, a contextual menu appears so you can add any extended GO-29 opcodes described in the section Special 8* Opcodes.

Finally note there is a touchable switch-views control that controls how to display your program's description: either plain Text or full HTML. The default is Text with semi-colon as the comment character, just like GO-25. But GO-29 extends this and allows full HTML for rich text and cool things like mathematical equations. This is explained in the section Naming and Documenting Your Program.

Topics

Function Keys
  • Recovering From Mistakes

    In addition to the four stack registers that automatically store intermediate results, the calculator also contains a separate automatic register, the Y register. This register preserves the value in the displayed X register before a new function is performed.

  • Prefix Clear

    The _Z key will clear a blue prefix key t, a gold prefix key r , STO, RCL, or GTO. To clear a prefix you have mistakenly pressed, merely press _Z, then press the correct key.

  • Absolute Value

    Some calculations require the absolute value, or magnitude, of a number. To obtain the absolute value of the number in the display, press @.

  • Integer Portion

    To extract and display the integer portion of a number, press n. The fractional portion of the number is lost. The entire number, of course, is preserved in the Y register.

  • Fractional Portion

    To place only the fractional portion of a number into the displayed X-register, press M. The integer portion of the number is lost. The entire number, of course, is preserved in the Y register.

  • Reciprocals

    To calculate the reciprocal of a number in the displayed X register, press O.

  • Square Roots

    To calculate the square root of a number in the displayed X register, press m.

  • Squaring

    To square a number in the displayed X register, press !.

  • Using Pi

    The value % accurate to 14 places (3.14159265358979) is provided as a fixed constant in GO-29. Merely press % whenever you need it in a calculation.

  • Percentages

    The I key is a two-number function that allows you to compute percentages. To find the percentage of a number:

    1. key in the base number
    2. press z
    3. key in the number representing percent rate
    4. press I

    For example, to calculate the sales tax on a purchase, the purchase price is the base number and the sales tax is the percentage rate.

    When I is pressed, the calculated answer writes over the percentage rate in the X register, and the base number is preserved in the Y register. Since the purchase price is now in the Y register and the amount of tax is in the X register, the total amount can be obtained by simply adding.

  • Trigonometric Functions

    The calculator provides you with six trigonometric functions. It also calculates angles in decimal degrees, radians, or grads; and it converts between decimal degrees and degrees, minutes, seconds. Use P, { or } to specify the degree mode.

    Note: 360 degrees = 2π radians = 400 grads.

    The six trigonometric functions provided by the calculator are:

    • j (sine)
    • K (arc sine)
    • k (cosine)
    • L (arc cosine)
    • l (tangent)
    • B (arc tangent)

    Each trigonometric function assumes angles in decimal degrees, radians, or grads. Trigonometric functions are one-number functions, so to use them you key in the number, then press the function key(s).

  • Hours (or Degrees), Minutes, Seconds / Decimal Conversions

    The T (to hours (or degrees), minutes, seconds) key converts decimal hours to the format of hours, minutes and seconds, or converts angles specified in decimal degrees to degrees, minutes, seconds. These hour and degree values are based on the sexagesimal (base 60) number system. When a time (or angle) is displayed in hours (or degrees), minutes, seconds format, the digits specifying hours (or degrees) occur to the left of the decimal point, while the digits specifying minutes, seconds, and fractions of seconds occur to the right of the decimal point. To see all these digits you should specify Q 5 display format. For example, the decimal 89.29047° displays as 89°, 17′, 25.7″ in H.MS format:

    Conversely, the $ (to decimal hours (or degrees)) key is used to change hours (or degrees), minutes, seconds into decimal hours (or degrees).

    The $ and T keys are important because trigonometric functions in GO-29 operate on angles in decimal degrees, but not in degrees, minutes, seconds. In order to calculate any trigonometric function of an angle given in degrees, minutes, seconds, you must first convert the angle to decimal degrees.

  • Polar/Rectangular Coordinate Conversion

    Two functions H and o are provided for polar/rectangular coordinate conversions. Polar angle θ is assumed in decimal degrees, radians, or grads, depending upon the trigonometric mode selected by P, {, or }.

    To convert values in the X and Y registers representing the rectangular coordinates (x, y), respectively, to polar coordinates (r, θ) (magnitude and angle, respectively), press H. Magnitude r then appears in the X register and angle θ is placed in the Y register.

    Conversely, to convert values in the X and Y registers representing the polar coordinates (r, θ), respectively, to rectangular coordinates (x, y) (abscissa and ordinate, respectively), press o. Coordinate x then appears in the X register and coordinate y is placed in the Y register.

  • Logarithm and Exponential Functions

    The calculator computes both natural and common logarithms as well as their inverse functions (antilogarithms):

    • u is loge (natural log). It takes the log of the value in X to base e (2.718...).
    • F is antiloge (natural antilog). It raises e (2.718...) to the power of the value in X. (To display the value of e, press 1 F.)
    • i is log10 (common log). It computes the log of the value in the X register to base 10.
    • G is antilog10 (common antilog). It raises 10 to the power of the value in the X register.

  • Raising Numbers to Powers

    The p key is used to raise numbers to powers. This function raises a positive real number to any real power; that is, the power may be positive or negative, and it may be an integer, a fraction, or a mixed number. p also permits you to raise any negative real number to the power of any integer within the calculating range of the calculator.

    In conjunction with O, p provides a simple way to extract roots. For example, the cube root of 5 is equivalent to 51/3 e.g.:

    5 z
    3 O
    p
  • Statistical Functions
    • Accumulations
      Pressing the g key automatically gives you several different sums and products of the values in the X and Y registers at once. In order to make these values accessible for sophisticated statistics problems, they are automatically placed by the calculator into storage registers R.₀ through R.₅ . The only time that information is automatically accumulated in the storage registers is when the g key is used. Before you begin any calculations using the g key, you should first clear the storage registers of data by pressing _¥.

      When you press the g key each of the following operations are performed on the data in the X and Y registers:

      • The number in X is added to the contents of storage register R.₁.
      • The square of the number in X is added to the contents of storage register R.₂.
      • The number in Y is added to the contents of storage register R.₃.
      • The square of the number in Y is added to the contents of storage register R.₄.
      • The number in X is multiplied by the contents of the Y register, and the product added to storage register R.₅.
      • The number 1 is added to storage register R.₀, and the total number in R.₀ is then written into the display. The stack does not lift.

      The number that you keyed into the X register is preserved in the Y register, while the number in the stack Y register remains in the Y register.

      Thus, each press of the Σ+ key updates these summations and multiplications. The contents of the displayed X register and the applicable storage registers are as follows:

      • R.₀ = X is n, the number of entries.
      • R.₁ is Σx, summation of x values.
      • R.₂ is Σx2, summation of x2 values.
      • R.₃ is Σy, summation of y values.
      • R.₄ is Σy2, summation of y2 values.
      • R.₅ is Σxy, summation of products of x and y values.

      Again, before you begin any calculations using the g key, you should first clear the storage registers of data by pressing _¥.

      There is a special flavor of storage register recall f g that summons only Σx and Σy, and stores them in X and Y, respectivfely, overwriting the contents of those two registers. The stack does not lift. (This feature is particularly useful when performing vector arithmetic, discussed shortly.)

      To recall any of the summations individually at any time, you can recall the contents of the desired storage register into the X register by pressing f followed the number key of the storage register address .₀ though .₅. After you have pressed g, recalling storage register contents or keying in another number writes over the number of entries (n) that is displayed. The stack does not lift.

    • Mean
      The A (mean) key calculates the arithmetic average of x and y accumulated in registers R.₁ and R.₃, respectively, according to these formulae:
      x̄ = `frac{1}{n}sum_(i=1)^nx_i`     ȳ =`frac{1}{n}sum_(i=1)^ny_i`

      The resultant values for x̄ and ȳ are available on the stack, in the X and Y registers, respectively.

    • Standard Deviation
      The S (standard deviation) key computes a measure of dispersion around the mean by using data accumulated in the storage registers R.₀ through R.₅, according to these formulae:
      `s_(x)=sqrt(frac{sumx^2-(sumx)^2/n}{n-1})`     `s_(y)=sqrt(frac{sumy^2-(sumy)^2/n}{n-1})`

      The resultant values vaues for sx and sy are available on the stack, in the X and Y registers, respectively.

      Note: a population standard deviation is computed from the sample standard deviation by:

      `sigma=ssqrt(frac{n-1}{n})`

    • Deleteing and Correcting Summation Data
      If you key in an incorrect value and have not pressed Σ+, press CLX and key in the correct value.

      If one of the values is changed, or if you discover after you have pressed the Σ+ key that one of the values is in error, you can correct the summations by using the D key as follows:

      1. Key the incorrect data pair into the X and Y registers. (You can use Y to return a single incorrect data value to the X register.)
      2. Press D to delete the incorrect data.
      3. Key in the correct values for x and y. (If one value of an X,Y data pair is incorrect, both values must be deleted and reentered.)
      4. Press g.

      The correct values for mean and standard deviation are now obtainable by pressing A and S.

    • Vector Arithmetic
      You can add or subtract vectors by combining the polar/ rectangular conversion functions (the H and o keys) with the summation functions (the g and D keys).

      For an example of this, examine the Sample Program Apeneck Sweeney as he flies the Swordfish into a crossing headwind.

    Topics

Part II - Programmatic Usage

Three Modes Of Operation

There are three ways to use your GO-29 calculator:

  1. Manual RUN Mode
    The functions and operations you have learned about in previous sections are performed manually one at a time with the PRGM-RUN switch set to RUN. These functions combined with the automatic register stack enable you to calculate any problem with ease.
  2. PRGM Mode
    In PRGM mode the functions and operations you have learned about are not executed, but instead are recorded in a part of the calculator called program memory for later execution. All operations on the keyboard except the following can be recorded for later execution while in PRGM mode:
    • SST - single-step foreward through program memorey
    • w - backward-step through program memory
    • e . n n or the GO-29 extension e + n n n - position step pointer to designated step number
    • ¬ - deletes current step from program memory
    • _X - clears all 198 steps of program memory
    • _Z - cancels r, t, STO, RCL or GTO
    These operations work in PRGM mode to help you write, record and edit your programs from the keyboard.
  3. Automatic RUN Mode
    The calculator can also be used to automatically execute a list of operations with the PRGM-RUN switch set to RUN if they have previously been recorded in program memory. Instead of your having to press each key manually, the recorded operations are executed sequentially in automatic RUN mode when you press GTO, GSB or R/S (run /stop). You press only one key and the entire list of recorded operations is executed much more quickly than you could have executed them yourself.

Topics

GO-29 Program Memory

A program is nothing more than a series of calculator keystrokes that you would press to solve a problem manually. The calculator remembers these keystrokes when you key them in, then executes them, in order, whenever you wish. You've already seen this demonstrated in the section Programmed Problem Solving, which you may wish to review.

All HP-29C programming techniques work with GO-29, although this App has some useful extensions. The first is the amount of program memory available for storing the keystrokes that define your program, now increased to 198 steps. When you set the calculator to PRGM mode you can examine the contents of program memory; logically, here is how the surface area program is stored:

00


01

© 0

02

!

03

%

04

?

05

§

06

R/S

198

R/S

Each step of program memory can store a single operation, whether that operation consists of one, two, three, or four keystrokes. Thus, one step of program memory might contain a single-keystroke operation like CHS, while another step of program memory could contain a two-keystroke operation, like STO 6. Step 01 of program memory currently contains an operation that requires three keystrokes, t GTO 0, which we understand to be © 0.

However, what is actually stored in program memory are not instruction pneumonics, but rather keycodes, discussed now.

Topics

GO-29 Keycodes

You can tell from the display what keystrokes are loaded into each step of program memory by means of the keycodes for those keys. Let's look at some keycodes now. If you have cleared the surface area of a sphere program illustrated in the section Programmed Problem Solving, please reenter it now before continuing.

With the calculator in PRGM mode, press the 4 keys e . 0 0 (go to step number 00) to return the calculator to the beginning of program memory. The number that you see on the left side of the display indicates the step number of program memory to which the calculator is set. You should be set at step 00, indicated by a display of 00. Now we'll use the q (single-step) key to examine the next step of program memory. q lets you step through program memory, one program step at a time.

PressDisplay
SST01 15 13 00

The calculator is now set to step 01 of program memory, as indicated by the number 01 that you see on the left side of the display. The other numbers in the display are as many as three two-digit keycodes for the keystrokes that have been loaded into that step of program memory.

Each key on the calculator has a keycode. For each keycode, the first digit denotes the row of the key on the keyboard and the second digit identifies the column of the key in that row (there are 7 rows of keys, and 4-5 columns of keys per row). Always count from the top down, and from left to right. Each key, no matter its size, counts as one keystroke.

For convenience, digit keys are identified by two digit keycodes of 00 through 09, except when prefixed by r or t. When preceeded by either of these prefix keys the digit keys are identified by the row-column keycode.

Now use the SST key again to examine the keycodes in the next step of the program:

PressDisplay
SST02   15 63

This table should help explain the keycodes for steps 01 and 02. For step 01 the first two key presses are located by row-column intersection, and collape into the © pneumonic. The third key press is a simple number 0 key so it is mapped to its two-character numeric keycode, there is no row-colum mapping. In contrast, both step 02 keycodes use row-column intersection to locate the key press, even the number 2 key because it is prefixed by t, and the 2 keys collapse into !.

Step

Key

Keycode

Row

Column

Result

01

t

15

1

5


GTO

13

1

3

©


0

00

-

-

© 0







02

t

15

1

5


2

63

6

3

!

GO-29 provides four extended keycodes, the 8* series, named because they assume the existence of an 8th row of calculator keys. Because there are no such keys, these opcodes are inserted using a contectual menu activated from the program listing auxiliary view. The new instructions, DMP, BEL, SEC and RND are explained in the section Special 8* Opcodes.

Topics

GO-29 Programming Keys

The programming keys described in this section help you write, edit and run programs. Specifics depend upon which of the three calculator modes you are using.

  1. PRGM Mode
    These keys are never recorded in program memory:
    • e . n n or the GO-29 extension e + n n n
      Goto positions the internal step pointer to an explicit step number.
    • SST
      Single step advances the step pointer forward for examining and/or changing program steps.
    • BST
      Back step moves the step pointer backwards for examining and/or changing program steps.
    • ¬
      Deletes the current instruction from program memory. All subsequent instructions move up one step in program memory.
    • _X
      Clears all 198 program memory steps to R/S instructions and resets the step pointer to step 00.
    • _Z
      Cancels r, t, STO, RCL or GTO.
  2. Manual RUN Mode
    • e . n n or the GO-29 extension e + n n n
      Goto positions the internal step pointer to an explicit step number without executing instructions.
    • GTO followed by a label number 0 through 9, or indirect label ¤ (described in section Using the R₀ Register for Indirect Control)
      Goto searches downward through program memory to first designated label and sets step pointer without executing instructions.
    • GSB followed by a label number 0 through 9, or indirect label ¤ (described in section Using the R₀ Register for Indirect Control)
      Goto subroutine searches downward through program memory to first designated label and starts executing instructions.
    • §
      Return sets the step pointer to 00 without executing instructions.
    • SST
      Single step displays the step number and keycode of the current program memory step when pressed; executes instruction, displays result, and moves to next step when released.
    • BST
      Back step displays the step number and keycode of the previous program memory step when pressed; moves to previous step when released - the program is not run in reverse.
    • R/S
      Run/Stop. Begins execution of a stored program from the current step pointer. Stops execution if program is running.
    • ¬
      Clears t prefix key.
    • _X
      Clears r prefix key.
    • _Z
      Cancels r, t, STO, RCL or GTO.
  3. Automatic RUN Mode
    • GTO followed by a label number 0 through 9, or indirect label ¤ (described in section Using the R₀ Register for Indirect Control)
      Goto searches downward through program memory to first designated label and continues executing instructions.
    • GSB followed by a label number 0 through 9, or indirect label ¤ (described in section Using the R₀ Register for Indirect Control)
      Goto subroutine searches downward through program memory to first designated label and executes that section of memory as a subroutine.
    • §
      Return. If executed as a result of pressing GSB and a label designator or execution of a GTO instruction, stops execution and returns control to keyboard. If executed as a result of a GSB instruction, returns control to next step after the GSB instruction.
    • PAUSE
      Pause. Stops program execution for 1 second and displays contents of the X register, then resumes program execution.
    • R/S
      Run/Stop. Stops program execution.
    • Conditionals   R   b   ®   ¯   #   N   °   [
      These instructions make tests and branch instruction flow accordingly, and are discussed in the section Branching.

Topics

Anatomy of GO-29 Program Execution

The section Programmed Problem Solving provided a concise overview of how to write, load and run our surface area of a sphere program. Let's delve deeper into those topics.

Define the Program

Recall that the program itself is demarcated with a leading © n instruction and a trailing § instruction.

  00   


  01151300

© 0

  02 1563

!

  03 1573

%

  04  61

?

  05 1512

§

  06  74

R/S

  198  74

R/S

The symbolic label n designates one of ten valid program markers 0 - 9. The use of ©s permits you to have several different programs or parts of programs loaded into the calculator at any time and to run them in any order you choose.

To define the end of a program, you should use a § instruction. When the calculator is executing a program and encounters a § instruction in program memory, it stops (unless executed as part of a subroutine - more about subroutines later). Another instruction that will cause a running program to stop is R/S. When a running program executes a R/S instruction in program memory, it stops just as it does when it executes §. Good programming practice, however, dictates that you normally use § rather than R/S to define the end of your program.

Run the Program

To run the surface area of a sphere program you have only to set the calculator to RUN mode, key in any needed data, then press ¦ and the number key (0 - 9) that labels your program. What is the surface area of Mercury, in kilometers?

PressDisplay
4879.4 GSB 074796748.05
Searching for ©s

When you switched to RUN mode in the previous example, the calculator was set at an unknown step number. When you pressed GSB 0, the calculator began searching sequentially downward through program memory, beginning with the current step, for a © 0 instruction. When the calculator searches, it does not execute instructions.

Each of the memory label markers (0 - 9) can be used as many times as you wish. In fact, you can label each of several programs and subroutines with the same number.

In executing the program you recorded, if the calculator reached the last step of program memory, step 198, without encountering a © 0 instruction, it would then wrap to step 00 and continue searching sequentially. Only when the calculator found a © 0 instruction in step 01 did it begin executing instructions. If the label is not found, the calculator will execute no instruction, Error will be displayed and program memory will be set back to the step at which the search began. Pressing v or any key clears the error.

Executing Instructions

When the calculator found the © 0 instruction in step 01, it ceased searching and began executing instructions. The calculator executes instructions in exactly the order you keyed them in, performing the operation in step 02 first, then step 03, etc., until it executes a § instruction or a R/S instruction . Since a § instruction is executed in step 05, the calculator stops there and displays the contents of the X register. (To see the next step number of program memory after the one at which the calculator has stopped, you can briefly switch to PRGM mode.) Everytime you key in a new value of a sphere diameter in RUN mode and press GSB 0, the calculator repeats this procedure.

You can see that it is possible to have many different programs or parts of a program loaded in the calculator at any time. You can run anyone of these programs by pressing GSB followed by the number key 0 - 9 that corresponds with its label.

It is also possible to have several different programs or routines defined by the same label. For example, suppose you had three programs that were defined by © 1 as illustrated here: In this example when you press GSB 1, the calculator searches sequentially through program memory from wherever it was located until it encounteres the first © 1 instruction. The calculator then executes instructions until it executes a § or a R/S instruction and stops.

If you had then pressed GTO 1 rather than GSB 1, the calculator would resume searching sequentially from the § or R/S through program memory until it encountered the second © 1, whereupon it would stop. Note that when you search for a label manually from the keyboard using GSB, the calculator will begin execution after it locates the label. But if you search for a label manually from the keyboard using GTO, the calculator will find the label and wait for you to press R/S to begin execution. Refer to the section Subroutines for more information about GTO and GSB.

When you press R/S, the calculator executes all subsequent instructions until it executes a § or a R/S and stops. When you press GSB again, the calculator searches downward to the third © 1 instruction and begins execution there.

©s and Step 00

The labels 0 - 9 in your programs act as addresses - they tell the calculator where to begin or resume execution. When a label is encountered as part of a program, execution merely "falls through" the label and continues onward. For example, in the program segment shown below, if you press GSB 0, execution would begin at © 0 and continue downward through program memory, on through the © 3 instruction, and continue until the § was encountered and execution was stopped. Execution falls through step 00, too. You can load instructions into steps 01 through 198 of program memory, but you cannot load an instruction into step 00. In fact, step 00 merely acts as a kind of origin in program memory, a beginning point for the loading of a program. When step 00 is encountered by a running program, execution continues without a halt from step 198 to step 01, just as if step 00 were not there.

Debugging

Debugging a program on an actual HP-29C can be very difficult because you cannot easily see the state of the calculator's storage registers without recalling them individually to the stack. On the other hand, GO-29's auxiliary information views, Settings, and 8* series of new instructions give an unparalleled view of the registers and stack, making debugging much easier.

  • Running One Step at a Time
    If all you need is to see the stack registers, then the SST single step command works beautifully. To use this method, do not start program execution with GSB or R/S, rather, position the step pointer to the first program step using GTO then press SST. This runs that step and only that step. Then you can manipulate the stack and check the contents of the four registers for sanity. Repeat as required.
  • Running in Slow Motion
    The Settings option Program Run Speed controls how fast a program runs by varying the time delay before running subsequent program steps.
  • Running Full Speed with DMP
    Inserting opcode 80 in your program dumps the calculator's internal state to the Paper Tape.

Topics

GO-29 Program Editing

Editing a program in PRGM mode consists of four basic maneuvers: clearing stuff, positioning the step pointer to an instruction of interest, deleting instructions at the step pointer, and inserting new instructions after the step pointer. GO-29 adds "full screen" editing to the mix, which deletes and rearranges instructions.

  1. Clearing stuff
    • _X clears all 198 program memory steps to R/S instructions and resets the step pointer to step 00.
    • _Z cancels r, t, STO, RCL or GTO.
  2. Positioning the Step Pointer
    • e . n n or the GO-29 extension e + n n n
    • SST single step
    • BST back step
    • RTN in RUN mode sets the step pointer to step 00
  3. Deleting Instructions
    The ¬ key erases the instruction at the current step of program memory, and all subsequent instructions in program memory move upward one step. An R/S instruction drops in to fill the vacated step 198.
  4. Inserting Instructions
    If you press a recordable operation, it will be loaded in the next step of program memory, and all subsequent instructions will be "bumped" down one step in program memory. Program step 198 is lost off the end of program memory. You should always view the contents of the last few steps of program memory before adding instructions to a program to ensure that no vital instructions disappear.
  5. Editing the Program Listing
    The program listing auxiliary window has a special Edit (Done) button on step 00 that enables removal and re-arrangement of program steps.

    Touching the red minus removes that program step and adds a R/S at step 198. Touching and dragging a gripper pad moves that program step, re-inserting it when you have reached the destination and released the gripper.

Topics

Branching

We have used e . n n or the GO-29 extension e + n n n to help edit our programs. This form of GTO cannot be recored as part of program, but there is a variant which can: GTO followed by a label designator 0 - 9, or the indirect label ¤ (described in section Using the R₀ Register for Indirect Control).

  • Unconditional
    When the calculator is executing a program and encounters a GTO n instruction, for example GTO 1, it immediately halts execution and begins searching sequentially downward through program memory for that label. When the first © 1 instruction is then encountered, execution begins again.
  • Conditional
    Each conditional operator tests the value in the X register against that in the Y register or 0 as indicated. If true, the calculator executes the instruction in the next program memory step. If false, the calculator skips the next step and continues execution after the skipped program step. This is the "Do if TRUE" rule, and GTO is the most commonly done instruction after one of these tests. This will branch program execution to another section of program memory if the conditional test is true:
    R   b   ®   ¯   #   N   °   [  

Topics

Program Interruptions

There may be occasions when you want a program to halt during execution so that you can key in data, or to pause so that you can quickly view results before the program automatically resumes running. Other interruptions may be an overt keyboard action on your part, or even a runtime error such as divsion by zero or arithmetic overflow.

  • R/S
    The run/stop function can be used either as an instruction in a program or pressed from the keyboard. When pressed from the keyboard, if a program is running, R/S stops the program. If a program is stopped or not running and the calculator is in RUN mode, R/S starts the program running beginning with the current location in program memory. You can use these features to stop a running program at points where you want to key in data. After the data has been keyed in, restart the program using the R/S key from the keyboard.
  • U
    The pause function suspends program execution for one second. You can stack multiple pauses to lengthen the delay time, or use the Program Run Speed Settings option to delay between every program step.
  • Error Stop
    If the calculator attempts to execute any error-causing operation during a running program, execution immediately halts and the calculator displays the word Error. To see the step number and keycode of the error-causing instruction, you can briefly set the calculator to PRGM mode, or simply examine the program listing window. Press v to clear the error. You can then resume program execution by pressing R/S from the keyboard in RUN mode.

Topics

Subroutines

Often, a program contains a certain series of instructions that are executed several times throughout the program. When the same set of instructions occurs more than once in a program, it can be executed as a subroutine. A subroutine is selected by the ¦ operation, followed by a label designator 0 - 9, or the indirect label ¤ (described in section Using the R₀ Register for Indirect Control).

Overview

A ¦ instruction transfers execution to the routine specified by the label address, just like a e instruction . However, after a ¦ instruction has been executed, when the running program then executes a §, execution is transferred back to the next instruction after the ¦. Execution then continues sequentially downward through program memory. The illustration below should make the distinction between e and ¦ clearer. As you can see, the only difference between a subroutine and a normal branch is the transfer of execution after the §. After the e, the next § halts a running program; after a ¦, the next § returns execution back to the main program, where it continues until another § (or R/S) is encountered. The same routine may be executed by e and ¦ any number of times in a program.

For example, a quadratic equation of the form `ax^2+bx+c = 0` has two roots found by the formula:

`r=frac{-b+-sqrt(b^2-4ac)}{2a}`

The roots differ by a `+-` term, which means that the remaining expressions can be refactored into a subroutine. The program Quadratic Roots uses two entry points, © 5 computes the positive root and © 6 computes the negative root, with a common subroutine © 8 used by both.
Usage

Subroutines give you extreme versatility in programming. A subroutine can contain a loop, or it can be executed as part of a loop. Another common and space-saving trick is to use the same routine both as a subroutine and as part of the main program. The program Dice shows this trick in action, read the program's comments for complete details.

Part of the program is a home-grown pseudo random number generator, which, since it's not a native instruction, occupies several steps of valuable program memory. GO-29 provides a RND instruction, part of the the 8* series of extended keycodes, which generates really random numbers, and saves program memory as well. The program DiceRND demonstrates how to retrofit RND into Dice.

Limits

A subroutine can call up another subroutine, and that subroutine can call up yet another. Subroutine branching is limited only by the number of §s that can be held pending by the calculator. Three subroutine returns can be held pending at any one time in the HP-29C, although GO-29 doubles that to 6 nested subroutine calls.

The calculator can return to the main program from subroutines that are 6 deep; however, if you attempt to call up subroutines that are more than 6 deep, the calculator will execute only 6 returns, and execution will stop prematurely. To illustrate this and to keep the diagram simple, let's assume that only two subroutine returns are allowed: The step numbers that §s return to are kept in an ordered list known as a Last In First Out (LIFO) queue. What this means is that as GSBs are processsed, they push their return address on the end the LIFO queue, and as §s are executed they pop the most recent return address off the end of queue. As long as there is room at the end of the LIFO queue for GSB to attach its return address, a § can grab it and transfer control appropriately. When a § is executed and the LIFO queue is empty, the program has no where to go and simply ends.

To understand the diagram above, it's very important to realize then when a GSB is executed from the keyboard (i.e. to start the Main Program) the LIFO queue is first emptied, all § information is erased. This means that the GSB 1 instruction creates the first LIFO queue entry, which contains the return step number after the GSB 1.

Now follow the blue numbered arrows: when GSB 2 is processed it pushes the second return entry onto the LIFO queue. But when GSB 3 is processed the LIFO § queue is full, so the first entry is discarded to make room for the current entry. At this point the calculator only knows how to return from GSB 3 and GSB 2, the return information for GSB 1 has been lost.

When the © 3 subroutine executes its § it pops the most recent LIFO entry and returns to the step after GSB 3. The return queue now has only one entry left. When the © 2 subroutine executes its § it pops the single remaining LIFO entry and returns to the step after GSB 2. The § LIFO queue has no more return information, thus the program ends when subroutine © 1 executes its §.

It's easy enough to probe the calculator and determines its § nesting depth: write a program, as above, with many nested subroutine calls, and keep replicating subroutine after subroutine until the program fails to return to the main program. This could work if you are ambitious and the nesting level is small, or you might never succeeed in any reasonable amount of time. But there is a clever way to accomplish this using a recursive subroutine, a subroutine that calls itself. So instead of writing `n_29` subroutines, write one and have it call itself `n_29` times. Visit the Sample Program Recursive Test Of Subroutine Limits to see how this is done.

Topics

Controlling the R₀ Register

The R₀ register is special. Using R₀ in conjunction with other instructions, you can specify the storage register addresses of STO and RCL, and the label addresses of GTO and GSB. By storing a negative number in R₀, you can even transfer execution to any step number of program memory. The « and ª instructions permit you to increment (add 1 to) or decrement (subtract 1 from) the current value in R₀. These are features that you will find extremely useful in controlling loops.

The ª (decrement R₀, skip if zero) instruction subtracts 1 from the contents of the R₀, then tests to see if the register is 0. (A number between +1 and -1 tests as zero.) If R₀ is greater than zero, execution continues with the next step of program memory. If R₀ is zero, the calculator skips one step of program memory before resuming execution. « works similarly except, of course, it increments R₀. For an example, see Manhattan.

Topics

Using the R₀ Register for Indirect Control

You have seen how the value in R₀ can be altered using the STO, « and ª operations. But the value contained in R₀ can also be used to control other operations. The indirect function ¤, combined with certain other functions allows you to control those functions using the current number in R₀. ¤ uses the number stored in R₀ as an address.

Summary of Indirect Operations

The indirect operations that can be controlled by R₀ are:

  • d ¤, when the number in R₀ is 0 through 29, stores the value that is in the displayed X register into the primary or indirect storage register addressed by the integer portion of the absolute value of the current number in R₀.
  • f ¤, when the number in R₀ is 0 through 29, recalls the contents of the primary or indirect storage register addressed by the current number in R₀.
  • d + ¤, d - ¤, d ? ¤, and d / ¤, when the number in R₀ is 0 through 29, perform storage register arithmetic upon the contents of the primary or indirect storage register addressed by the current number in R₀.
  • e ¤, when the number in R₀ is 0 or a positive 1 through 9, transfers execution of a running program sequentially downward through program memory to the next label specified by the current number in R₀.
  • e ¤, when the number in R₀ is a negative number between -1 and -198, transfers execution of a running program back in program memory the number of steps specified by the current negative number in R₀.
  • ¦ ¤, when the number in R₀ is 0 through 9, transfers execution of a running program to the subroutine specified by the current number in R₀. Like a normal subroutine, when a § is then encountered, execution transfers and continues with the step following the ¦ ¤.
  • ¦ ¤, when the number in R₀ is a negative number between -1 and -198, transfers execution of a running program back in program memory the number of steps specified by the current negative number in R₀. Execution from that point is like a normal subroutine, so if a § instruction is then encountered, execution is transferred once again, this time to the next instruction after the ¦ ¤.
Note that you can use the ¤ key with the above functions with or without using the t prefix key. That is, pressing d ¤ is the same as pressing d t ¤.

If the number in R₀ is outside the specified limits when the calculator attempts to execute one of these operations, the display will show Error. When using ¤, the calculator uses for an address only the integer portion of the number currently stored in R₀. Thus, 25.99998785 stored in R₀ retains its full value there, but when used as address ¤, it is read as 25 by the calculator.

Store and Recall

You can use the number in R₀ to address the 30 storage registers that are in your calculator. When you press d ¤, the value that is in the display is stored in the storage register addressed by the number in R₀. f ¤ addresses the storage registers in a like manner, as do the storage register arithmetic operations d + ¤, d - ¤, d ? ¤, and d / ¤.

When using d ¤, f ¤, or any of the storage register arithmetic operations utilizing the ¤ function, R₀ can contain numbers positive or negative from 0 through 29. The numbers 0 through 15 address primary storage registers R₀ - R₉ and R.₀ - R.₅, while numbers from 16 through 29 will address indirect storage registers R₍₁₆₎ - R₍₂₉₎.

The only way to access an indirect storage register is via the ¤ function. Notice that with the number 0 in R₀, ¤ addresses R₀ itself!

Branches and Subroutines

Like addressing storage registers, you can address routines, subroutines, even entire programs, indirectly through R₀. To address a routine using R₀, use the instruction e ¤. Execution is transferred sequentially downward to the © 0 - 9 that is addressed by the number in R₀.

Subroutines can also be addressed and utilized with R₀. When ¦ ¤ is executed in a running program (or pressed from the keyboard), execution transfers to the specified © and executes the subroutine. When a § is then encountered, execution transfers back to the next instruction after the ¦ ¤ and resumes.

Remember that the numbers in R₀ must be positive or zero (negative numbers cause rapid reverse branching, which we discuss next), and that the calculator looks at only the integer portion of the number in R₀ when using it for an address.

Rapid Reverse Branching

Using e ¤ and ¦ ¤, with a negative number stored in R₀, you can actually branch to any step number of program memory. The calculator does not search for a label, but instead transfers execution backward the number of steps specified by the negative number in R₀. This is advantageous because the branch is faster than searching for a label, and because you can thus transfer execution even though all labels in the calculator have been used for other purposes.

Rapid reverse branching can be specified with numbers from -1 through -198. If you attempt to execute an indirect control transfer when the magnitude of the integer portion of the negative number in R₀ is greater than 198, the calculator displays Error.

Suppose the step pointer is at 2, then a rapid reverse branch (RRB):

  • of -1 sets the step pointer to 1.
  • of -2 sets the step pointer to 198.
  • of -3 sets the step pointer to 197.
  • of -197 sets the step pointer to 3.
  • of -198 sets the step pointer once again to 2.

For an example see Fibonacci Rapid Reverse Branching.

Topics

Part III - GO-29 Programs

Special 8* Opcodes

GO-29 supports four special keycodes not available on a real HP-29C. These are collectively known as the 8* series of instructions, named because they exist on a theoretical 8th row of calculator keys having an infinite number of columns. You cannot key these instructions in, but they can be typed as part of a program imported into the calculator. Or, in PRGM mode, if you touch and hold a program listing step, a contextual menu appears so you can add extended GO-29 opcodes. See the section on keycodes for background information.

  1. DMP (80) dumps the step pointer and the stack and memory registers to the paper tape for debugging.
  2. BEL (81) sounds a tram bell. BEL (14 81) sounds BEL1 (win), while BEL (15 81) sounds BEL2 (lose).
  3. SEC (82) stores the second of the day 0 - 86,399 in X, handling the stack just like an RCL.
  4. RND (83) replaces X with a random integer 0 < abs(X) < 232, without otherwise changing the stack.

Topics

Naming and Documenting Your Program

A GO-29 program can exist by itself, a simple stream of step numbers and instructions, just like an HP-29C program, or it can be bundled with its documentation in a structure called a Program Package. A Program Package is not a new idea, GO-25 established a simple version of this concept for bundling a program and its descriptive comments. GO-25 descriptive comments are limited to simple Text, but GO-29 extends this and additionally allows rich HTML documentation.

A Program Package is really easy to maintain, it's just a file (ASCII or UTF-8 Unicode), and consists of two parts: the documentation at the top / beginning, immediately followed by the program. That's it. Simple enough to manage in most any editor you choose.

Generally, it's useful to associate a name with a program, and GO-29 tries to extract the name from the documentation as the program is being read into memory. If you provide no documentation at all, or do not adhere to the following prescribed naming rule, then Untitled-go29.txt is used.

While the program is being read into memory GO-29 is also scanning the documentation to determine if it's plain Text or rich HTML, by searching for a case-insensitive <html> / </html> tag pair. This defines the start and end of the HTML documentation; if those two strings are not found then the documentation is assumed plain Text.

Finally, the prescribed program naming rule is:

  • you get to pick the actual name of the program, even including spaces
  • you must suffix the characters "-go29" to the chosen program name
  • and you must suffix an extension, either ".txt" or ".html"
e.g. Einstein Tensor-go29.html

Note: The extension does not specify whether the program documentation is Text or HTML, it simply reminds humans what the document contains, and reminds computers that the program is an editable file.

Text Documentation

Lacking <html> / </html> marker strings, program documentation is assumed plain Text, with the semi-colon as the comment character. All comments appearing before the first program step 01 are gathered together and appear in the top of the program listing window. This window is editable, and the descriptive text is saved with the program steps when the program is exported.

By definition the very first documentation line specifies the program name, excluding the semi-colon, of course.

e.g. ; Einstein Tensor-go29.txt

For an example, visit the Sample Program Empty Program Text Documentation.

HTML Documentation

If <html> / </html> marker strings are present, program documentation is assumed to be HTML. The HTML is rendered and displayed in the top of the program listing window. Program step 01 immediately follows the </html> tag. This HTML window is not editable - touch the switch-views control to toggle into Text mode to view and edit the raw HTML source. The descriptive text is saved with the program steps when the program is exported.

By definition a <title> / </title> tag pair surrounds the program name.

e.g. <title>Einstein Tensor-go29.html</title>

The title tag is contained in the document's <head> section, you will want to include these lines as well:

        
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="viewport" content="initial-scale=1.0" />
For an example, visit the Sample Program Empty Program HTML Documentation.

Topics

Storing and Organizing Programs

Beginning with iOS 11 managing your programs is relatively easy using Apple's Files App. Files not only provides a storage location for your programs such as iCloud Drive or Dropbox, but also allows you to create subfolders and maneuver between them, which means you can setup a file hierachy that is meaningful to you. To take advantage of theses capabilities, incorporate Files in your import and export workflows.

If you have iCloud Drive configured then GO-29 creates a folder similar to this for Files to store and retrieve your programs. Tapping the display in PRGM mode brings up the Import PRGM / Share PRGM menu, allowing you to transfer programs between GO-29 and Files.

  • To export a program to Files select Share PRGM from this menu:
    1. Open In Another App
    2. Save to Files, which runs Files
    3. Navigate to the destination folder
    4. Add
  • To import a program from Files:
    1. First run the Files App
    2. Naviagte to the desired folder
    3. Long touch the desired program to display the Action menu
    4. Share
    5. Copy to GO-29, which runs GO-29
    6. This displays the standard Import PRGM menu with your desired program as one of the items, select the program

Additional help is available in the following sections Importing Programs and Sharing Programs.

Topics

Importing Programs

On an actual HP-29C programs are entered using the calculator keys. That method works with GO-29 as well, but it's often easier to edit your programs in another App and import them into GO-29 (activate the Import menu by touching the calculator's display in PRGM mode). For instance, you can use Mail to write your program, then copy the program to the pasteboard, switch to GO-29, and import the pasteboard data. As a bonus, when you are finished editing the program simply email it to yourself for later filing in your GO-29 programs folder.

You also have a My Programs container that uses iTunes File Sharing to sync programs between your computer and GO-29.

Preferably, Apps like Files use the iOS Document Model and have a menu to open their documents in another App (labelled variously as Add to appName, Copy to appName, Open in appName, or Save to appName). If such an App sends a program (named, say, Surface Area Of Sphere-go29.txt) to GO-29, that program's name appears in the Import PRGM window.

Finally, a small selection of programs is included in GO-29's Sample Programs container.

Topics

Sharing Programs

You can export a program in various ways using the Share PRGM menu item (activate the Share menu by touching the calculator's display in PRGM mode). Besides the pasteboard, email and printing, you also have a My Programs container that uses iTunes File Sharing to sync programs between your computer and GO-29.

Preferably, GO-29 also supports the iOS Document Model and allows other Apps to open its program files via the Open In Another App menu item. When sending a program to another App, GO-29 uses the program name to identify the program. For example, use this option to export a program to the Files App.

Topics

HP-29C Owner's Handbook Programs

Programs you may copy to the pasteboard and then import into GO-29 while in PRGM mode. Also, do check out the more complex and extensive repertoire of Sample Programs available from the Import PRGM menu.

Accountant-go29.txt
; Accountant-go29.txt
;
; Compute tax based on income. 17.5% nominal,
; 20% if you earn more than $10,000.
;
; Usage:
;   X = taxable amount
;   GSB 1
;
01 15 13 01 ; LBL 1
02 14 11 02 ; FIX 2
03       33 ; EEX
04       04 ; 4
05       21 ; Swap xy
06    14 51 ; x>y
07    13 02 ; GTO 2
08       01 ; 1
09       07 ; 7
10       73 ; .
11       05 ; 5
12    13 03 ; GTO 3
13 15 13 02 ; LBL 2
14       02 ; 2
15       00 ; 0
16 15 13 03 ; LBL 3
17    15 21 ; %
18    15 12 ; RTN
19       74 ; R/S
                    
Dice-go29.txt
; Dice-go29.txt
;
; This program simulates the throwing
; of a pair of dice, pausing to
; display first the value of one die
; (an integer from 1 to 6) ; and then
; pausing to display the value of the
; second die (another integer from 1
; to 6). Finally the values of the two
; dice are added together to give the
; total value of the throw.
;
; The heart of the program is a
; pseudo random number generator that
; is executed first as a subroutine
; and then as part of the main
; program. When you key in a first
; number, called a seed and press
; GSB 1, the digit for the
; first die is generated and displayed
; using the LBL 2 routine as a
; subroutine. Then the digit for the
; second die is generated using the
; same routine as part of the main
; program. The program then uses the
; generated number as a new seed for
; successive throws of the dice.
;
01 15 13 01 ; LBL 1
02 14 11 02 ; FIX 2
03    23 00 ; STO 0
04 15 13 00 ; LBL 0
05       00 ; 0
06    23 01 ; STO 1
07    12 02 ; GSB 2
08 15 13 02 ; LBL 2
09    24 00 ; RCL 0
10       09 ; 9
11       09 ; 9
12       07 ; 7
13       61 ; X
14    15 62 ; FRAC
15    23 00 ; STO 0
16       06 ; 6
17       61 ; X
18       01 ; 1
19       51 ; +
20    14 62 ; INT
21 14 11 00 ; FIX 0
22    14 74 ; PAUSE
23 23 51 01 ; STO + 1
24    24 01 ; RCL 1
25    15 12 ; RTN
26    13 00 ; GTO 0
27    15 12 ; RTN
28       74 ; R/S
                    
DiceRND-go29.txt
; DiceRND-go29.txt
;
; Just like Dice-go29.txt, this program
; uses a pseudo random number generator
; to simulate throwing a pair of dice.
; Please read the program documenttion
; for the real Dice to learn how this
; program flows.
;
; The salient difference is DiceRND uses
; GO-29's builtin RND function rather
; than rolling its own, hence reducing
; the memory footprint.
;
; RND step 09 replaces Dice steps 9-17.
;
01 15 13 01 ; LBL 1
02 14 11 00 ; FIX 0
03 15 13 00 ; LBL 0
04       00 ; 0
05    23 01 ; STO 1
06    12 02 ; GSB 2
07 15 13 02 ; LBL 2
08       06 ; 6
09       83 ; RND replaces Dice steps 09-17
10       01 ; 1
11       51 ; +
12    14 62 ; INT
13    14 74 ; PAUSE
14 23 51 01 ; STO + 1
15    24 01 ; RCL 1
16    15 12 ; RTN
17    13 00 ; GTO 0
18    15 12 ; RTN
19       74 ; R/S
                    
Fibonacci-go29.txt
; Fibonacci-go29.txt
;
01 15 13 02 ; LBL 2
02 14 11 02 ; FIX 2
03       34 ; CLX
04    23 00 ; STO 0
05       01 ; 1
06    23 01 ; STO 1
07    14 74 ; PAUSE
08 15 13 00 ; LBL 0
09    24 00 ; RCL 0
10    24 01 ; RCL 1
11       51 ; +
12    14 74 ; PAUSE
13    23 00 ; STO 0
14    24 00 ; RCL 0
15    24 01 ; RCL 1
16       51 ; +
17    14 74 ; PAUSE
18    23 01 ; STO 1
19    13 00 ; GTO 0
20    15 12 ; RTN
21       74 ; R/S
                    
Fibonacci Rapid Reverse Branching-go29.txt
; Fibonacci Rapid Reverse Branching-go29.txt
;
; Usage:
;   GSB 1
;
01    23 01 ; STO 1
02    24 01 ; RCL 1
03    24 02 ; RCL 2
04       51 ; +
05    14 74 ; PAUSE
06    23 02 ; STO 2
07    13 22 ; GTO i
08    15 12 ; RTN
09       74 ; R/S
10       74 ; R/S
11       74 ; R/S
12       74 ; R/S
13       74 ; R/S
14       74 ; R/S
15       74 ; R/S
16       74 ; R/S
17       74 ; R/S
18       74 ; R/S
19       74 ; R/S
20       74 ; R/S
21       74 ; R/S
22       74 ; R/S
23       74 ; R/S
24       74 ; R/S
25       74 ; R/S
26       74 ; R/S
27       74 ; R/S
28       74 ; R/S
29       74 ; R/S
30       74 ; R/S
31       74 ; R/S
32       74 ; R/S
33       74 ; R/S
34       74 ; R/S
35       74 ; R/S
36       74 ; R/S
37       74 ; R/S
38       74 ; R/S
39       74 ; R/S
40       74 ; R/S
41       74 ; R/S
42       74 ; R/S
43       74 ; R/S
44       74 ; R/S
45       74 ; R/S
46       74 ; R/S
47       74 ; R/S
48       74 ; R/S
49       74 ; R/S
50       74 ; R/S
51       74 ; R/S
52       74 ; R/S
53       74 ; R/S
54       74 ; R/S
55       74 ; R/S
56       74 ; R/S
57       74 ; R/S
58       74 ; R/S
59       74 ; R/S
60       74 ; R/S
61       74 ; R/S
62       74 ; R/S
63       74 ; R/S
64       74 ; R/S
65       74 ; R/S
66       74 ; R/S
67       74 ; R/S
68       74 ; R/S
69       74 ; R/S
70       74 ; R/S
71       74 ; R/S
72       74 ; R/S
73       74 ; R/S
74       74 ; R/S
75       74 ; R/S
76       74 ; R/S
77       74 ; R/S
78       74 ; R/S
79       74 ; R/S
80       74 ; R/S
81       74 ; R/S
82       74 ; R/S
83       74 ; R/S
84       74 ; R/S
85       74 ; R/S
86       74 ; R/S
87       74 ; R/S
88       74 ; R/S
89       74 ; R/S
90       74 ; R/S
91       74 ; R/S
92       74 ; R/S
93       74 ; R/S
94       74 ; R/S
95       74 ; R/S
96       74 ; R/S
97       74 ; R/S
98       74 ; R/S
99       74 ; R/S
100       74 ; R/S
101       74 ; R/S
102       74 ; R/S
103       74 ; R/S
104       74 ; R/S
105       74 ; R/S
106       74 ; R/S
107       74 ; R/S
108       74 ; R/S
109       74 ; R/S
110       74 ; R/S
111       74 ; R/S
112       74 ; R/S
113       74 ; R/S
114       74 ; R/S
115       74 ; R/S
116       74 ; R/S
117       74 ; R/S
118       74 ; R/S
119       74 ; R/S
120       74 ; R/S
121       74 ; R/S
122       74 ; R/S
123       74 ; R/S
124       74 ; R/S
125       74 ; R/S
126       74 ; R/S
127       74 ; R/S
128       74 ; R/S
129       74 ; R/S
130       74 ; R/S
131       74 ; R/S
132       74 ; R/S
133       74 ; R/S
134       74 ; R/S
135       74 ; R/S
136       74 ; R/S
137       74 ; R/S
138       74 ; R/S
139       74 ; R/S
140       74 ; R/S
141       74 ; R/S
142       74 ; R/S
143       74 ; R/S
144       74 ; R/S
145       74 ; R/S
146       74 ; R/S
147       74 ; R/S
148       74 ; R/S
149       74 ; R/S
150       74 ; R/S
151       74 ; R/S
152       74 ; R/S
153       74 ; R/S
154       74 ; R/S
155       74 ; R/S
156       74 ; R/S
157       74 ; R/S
158       74 ; R/S
159       74 ; R/S
160       74 ; R/S
161       74 ; R/S
162       74 ; R/S
163       74 ; R/S
164       74 ; R/S
165       74 ; R/S
166       74 ; R/S
167       74 ; R/S
168       74 ; R/S
169       74 ; R/S
170       74 ; R/S
171       74 ; R/S
172       74 ; R/S
173       74 ; R/S
174       74 ; R/S
175       74 ; R/S
176       74 ; R/S
177       74 ; R/S
178       74 ; R/S
179       74 ; R/S
180       74 ; R/S
181       74 ; R/S
182       74 ; R/S
183       74 ; R/S
184       74 ; R/S
185 15 13 01 ; LBL 1
186       01 ; 1
187       00 ; 0
188       32 ; CHS
189    23 00 ; STO 0
190       00 ; 0
191    23 01 ; STO 1
192       01 ; 1
193    23 02 ; STO 2
194    14 74 ; PAUSE
195    24 01 ; RCL 1
196    24 02 ; RCL 2
197       51 ; +
198    14 74 ; PAUSE
                    
Infinite Integer SQRT-go29.txt
; Infinite Integer SQRT-go29.txt
;
; Repeatively compute, display and pause,
; the square root of integers from 1 ...
;
; BEGIN : R/S or GSB 1
; STOP : R/S
;
01 15 13 01 ; LBL 1
02       00 ; 0
03    23 01 ; STO 1
04 15 13 04 ; LBL 4
05       01 ; 1
06 23 51 01 ; STO + 1
07    24 01 ; RCL 1
08    14 74 ; PAUSE
09    14 63 ; √
10    14 74 ; PAUSE
11    13 04 ; GTO 04
12    15 12 ; RTN
13       74 ; R/S
                    
Manhattan-go29.txt
; Manhattan-go29.txt
;
; 1977 : 353 years
;            $724,492,365.57
;            4-5 minutes on the original HP-29C.
;            GO-29 does the job in zero seconds :)
; Usage:
;   353 GSB 0
;   GSB 1
;
01 15 13 00 ; LBL 0
02 14 11 02 ; FIX 2
03    23 00 ; STO 0
04       01 ; 1
05       06 ; 6
06       02 ; 2
07       04 ; 4
08    23 01 ; STO 1
09       02 ; 2
10       04 ; 4
11    23 02 ; STO 2
12    15 12 ; RTN
13 15 13 01 ; LBL 1
14       82 ; SEC
15    23 09 ; STO 9
16    24 02 ; RCL 2
17       05 ; 5
18    15 21 ; %
19 23 51 02 ; STO + 2
20       01 ; 1
21 23 51 01 ; STO + 1
22    15 23 ; DSZ
23    13 01 ; GTO 1
24       82 ; SEC
25    23 08 ; STO 8
26    24 01 ; RCL 1
27 14 11 00 ; FIX 0
28    14 74 ; PAUSE
29    24 02 ; RCL 2
30 14 11 02 ; FIX 2
31    14 74 ; PAUSE
32    24 08 ; RCL 8
33    24 09 ; RCL 9
34       41 ; -
35    15 12 ; RTN
36       74 ; R/S
                    
Pythagorean Theorem-go29.txt
; Pythagorean Theorem-go29.txt
;
; Computes the hypotenuse of any right
; triangle, given the other two sides.
; The formula used is:
;
; c = √( a² + b² )
;
; Usage:
;       Y = length of one side
;       X = length of other side
;       GSB 9
;
01 15 13 09 ; LBL 9
02    15 63 ; x^2
03       21 ; Swap xy
04    15 63 ; x^2
05       51 ; +
06    14 63 ; √
07    15 12 ; RTN
08       74 ; R/S
                    
Quadratic Roots-go29.txt
; Quadratic Roots-go29.txt
;
; Find the roots of a quadratic equation
; ax² + bx + c = 0
;
; Usage for 3x² + 2x - 1:
;   3 STO 1
;   2 STO 2
;   1 CHS STO 3
;   GSB 5 ; compute root 1  0.33
;   GSB 6 ; compute root 2 -1.00
;
01 15 13 05 ; LBL 5
02 14 11 02 ; FIX 2
03    12 08 ; GSB 8
04       51 ; +
05    24 01 ; RCL 1
06       02 ; 2
07       61 ; X
08       71 ; ÷
09    15 12 ; RTN
10 15 13 06 ; LBL 6
11    12 08 ; GSB 8
12       41 ; -
13    24 01 ; RCL 1
14       02 ; 2
15       61 ; X
16       71 ; ÷
17    15 12 ; RTN
18 15 13 08 ; LBL 8
19    24 02 ; RCL 2
20       32 ; CHS
21    24 02 ; RCL 2
22    15 63 ; x^2
23    24 01 ; RCL 1
24    24 03 ; RCL 3
25       61 ; X
26       04 ; 4
27       61 ; X
28       41 ; -
29    14 63 ; √
30    15 12 ; RTN
31       74 ; R/S
                    
Surface Area Of Sphere-go29.txt
; Surface Area Of Sphere-go29.txt
;
; Compute the surface area of any
; sphere using the formula:
;
; A = π d²
;
; ENTRY:
;   X = diameter of sphere.
;   GSB 0
;
; EXIT:
;   X = surface area of sphere.
;
01 15 13 00 ; LBL 0
02    15 63 ; x²
03    15 73 ; π
04       61 ; X
05    15 12 ; RTN
                    

Topics

Epilogue

Improper Mathematical Operations

If you attempt a calculation containing an improper operation - say, division by zero - the display will show Error. To clear, press v.

The following are improper operations:

  • ÷ where X = 0
  • Yx where Y < 0 with X not an integer, or where Y = 0 with X < 0
  • √X where X < 0
  • 1/X where X = 0
  • log where X <= 0
  • ln where X <= 0
  • sin-1 where absolute value of X > 1
  • cos-1 where absolute value of X > 1
  • STO ÷ where X = 0
  • A where n <= 0
  • s where n <= 0

Topics

GO-29 Settings

These are the default Settings:

GO-29 Gesture Summary
  • Shake to clear X.
  • Single tap the display for Copy / Paste in RUN mode.
  • Single tap the display for Import PRGM / Share PRGM in PRGM mode.
  • Double tap the display to show/hide the stack, memory and paper tape views in RUN mode.
  • Double tap the display to show/hide the program description and listing views in PRGM mode .
  • Two-finger pan for iPad to reposition the stack, program and calculator views.
  • Touch and hold SST or BST in RUN mode to display the next or previous step, respectively.
  • Touch a program listing line to make it the current SP.
  • Touch a program listing line to dismiss the keyboard while editing the program description.
  • Touch and hold a program listing step for 0.75 second (long touch) to add special opcodes.
  • Touch switch-views control to alternate between two views.
  • Swipe up and down to scroll program description, program listing and sample programs views.
  • Swipe left and right to manipulate slide switches, if activated in Settings.
  • Flick left on the display to erase last mantissa character entered.
  • Triple tap the display to show/hide the Info button .

Topics

GO-29 versus HP-29C Differences
  • Maximum program steps has been doubled to 198.
  • Maximum number of nested subroutine calls has been doubled to 6.
  • GTO + n n n extends regular GTO . n n to address program steps [100,198]. This form of GTO can, of course, still address steps [000,099].
  • Y, Z and T registers, as well as the indirect storage registers, are continuous and survive a power Off.
  • No blinking decimal point to indicate low power.

Topics

What's New?

1.0 - 2019.04.08

  • Initial release.

Topics

Support

Copyright (©) 2019 - 2019 BigCatOs. All rights reserved.   |   Contact

Topics