Post Reply 
12C Oddity
10-07-2015, 08:28 PM
Post: #1
12C Oddity
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?
Find all posts by this user
Quote this message in a reply
10-07-2015, 09:11 PM
Post: #2
RE: 12C Oddity
(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
Find all posts by this user
Quote this message in a reply
10-08-2015, 01:44 AM
Post: #3
RE: 12C Oddity
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.
Find all posts by this user
Quote this message in a reply
10-10-2015, 03:53 PM
Post: #4
RE: 12C Oddity
(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.

-katie

Visit this user's website Find all posts by this user
Quote this message in a reply
10-10-2015, 05:37 PM
Post: #5
RE: 12C Oddity
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.
Find all posts by this user
Quote this message in a reply
10-10-2015, 07:21 PM
Post: #6
RE: 12C Oddity
(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.
Find all posts by this user
Quote this message in a reply
10-10-2015, 07:46 PM
Post: #7
RE: 12C Oddity
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.

-katie

Visit this user's website Find all posts by this user
Quote this message in a reply
10-10-2015, 08:12 PM
Post: #8
RE: 12C Oddity
(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
Find all posts by this user
Quote this message in a reply
10-11-2015, 01:27 PM (This post was last modified: 10-11-2015 01:28 PM by Don Shepherd.)
Post: #9
RE: 12C Oddity
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
Find all posts by this user
Quote this message in a reply
10-12-2015, 02:39 AM
Post: #10
RE: 12C Oddity
(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.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)