HP Forums

Full Version: 12C Oddity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Purchased a 12C the other day, probably the 10th new HP RPN calc I have purchased in the last 32 years. Right out of the box, I started pressing keys. Pressing R/S, I expected to see an error message, but instead it ran a program. The program was GTO 00, eight times.

I have never seen this before in a new calc, although I'm not sure which ones came with the batteries already installed. Has anyone bought a new HP with program lines in user memory?
(10-07-2015 08:28 PM)Dwight Sturrock Wrote: [ -> ]The program was GTO 00, eight times.

You get this when you execute CLEAR PRGM. The command GTO 00 has op-code 00. That's what you get when the first register is filled with zeros. I assume that this is just the minimal amount of program-memory.

Cheers
Thomas
The "program" looks like this:

Code:

00-
01- 43,33  00
02- 43,33  00
03- 43,33  00
04- 43,33  00
05- 43,33  00
06- 43,33  00
07- 43,33  00
08- 43,33  00

After reviewing the manual, it appears this is normal behavior- as Thomas said. Each register, consisting of 8 program lines, is converted to this sequence as the you expand the size of program. I found this confusing, being accustomed to the 15C.
(10-08-2015 01:44 AM)Dwight Sturrock Wrote: [ -> ]After reviewing the manual, it appears this is normal behavior- as Thomas said. Each register, consisting of 8 program lines, is converted to this sequence as the you expand the size of program. I found this confusing, being accustomed to the 15C.


The programming model for the 12C is incredibly simple compared to the 15C. All 100 possible GTO's take up just a byte in memory. The special GTO 00 instruction simply means halt as 00 is not a valid line number. This has the advantage of making programs take up less memory than the 15C but also greatly limits the number of possible instructions. The major downside to having no symbolic labels and having a dumber than dirt editor is that programs really can't be edited, so have to be reentered to accommodate almost any change.
I'll keep this in mind as I explore programming on the 12C. In my mind, the 42S is the sweet spot between simplicity & complexity, but there is still some fun & usefulness to be had with the simpler programming models.

As far as quality is concerned, this 2015 12C is very reminiscent of my 34C- fit & finish, and the action of the keys.
(10-10-2015 05:37 PM)Dwight Sturrock Wrote: [ -> ]I'll keep this in mind as I explore programming on the 12C. In my mind, the 42S is the sweet spot between simplicity & complexity, but there is still some fun & usefulness to be had with the simpler programming models.

As far as quality is concerned, this 2015 12C is very reminiscent of my 34C- fit & finish, and the action of the keys.

Here is a prime factorization program I wrote for the 12c a few years ago, based on a program Dave Britten adapted for the 32s.
Don's program is likely a lot more useful and understandable than my complicated programs for the 12C, but here are a couple of examples of how far one can push programming on the 12C (or 12C Platinum): linked list insertion sort and many digits of pi

What all of these program have in common is the not-at-all-obvious use of the cash flow registers as an array. Because there is no standard method for indirect addressing on the 12C it would make for a much more limited programming environment without this little trick of sorts.
(10-10-2015 07:46 PM)Katie Wasserman Wrote: [ -> ]What all of these program have in common is the not-at-all-obvious use of the cash flow registers as an array.

Another not-at-all-obvious use of the cash flow registers can be found in Valentin's paper: HP-12C’s Serendipitous Solver
And if you like simplicity and elegance (and Fibonacci numbers), try this 7-line program that doesn't sacrifice any registers:
Code:
1
enter
pse
+
last x
x<->y
gto 03
(10-10-2015 03:53 PM)Katie Wasserman Wrote: [ -> ]The major downside to having no symbolic labels and having a dumber than dirt editor is that programs really can't be edited, so have to be reentered to accommodate almost any change.

Incredibly, the manual devotes all of Section 10 to this "editor". Additions by Branching? That could lead to some spaghetti.

Nice examples, Don, Thomas, Katie. It will take some time to figure these out.
Reference URL's