30b programming environment



#2

OK, the 30b is out and will probably be available in a couple of months. While it is a financial calculator, it is programmable, like the 12c. It certainly has more capability than the 12c, but there are some things for an RPN programmer to watch out for. Here are a few of its features:

  1. Programming commands are printed on a plastic overlay that may be placed over the top four rows of keys. These commands are entered by holding down the shift key while pressing the corresponding key, and they are only effective in program edit mode while entering your code (except R/S, of course, which has its usual meaning in run mode).
  2. Any of ten user programs can be assigned to any key--shifted, unshifted, or shift+hold (with a couple of exceptions). This gives you a lot of flexibility in running your programs.
  3. Subroutines - Call/Return, big improvement over the 12c.
  4. Text prompts, another big improvement over the 12c.
  5. Solver. Not programmable, but you actually write a small program to use it.
  6. Conditionals, 6 of them. This will take some getting used to for the RPN programmer, because they don't work like other RPN programmable calculators. ?< means y<x here, not x<y. You'll have to be careful when adapting code from other calcs to the 30b. These tests don't use the traditional "do if true" rule; they use GotoT and GotoF based upon the condition code set by the conditional statement and placed on the stack. GotoT and GotoF pop the condition code off the stack before transferring.
  7. Indirect addressing of 100 registers (shared with stats and cash flow). R0 = index, accessed via RCL DATA and STO DATA (or RCL/STO Cashfl).
  8. Ten regular registers, 0-9. STO/RCL arithmetic with all 10, 290 bytes total program space, but STO 1 takes 2 bytes and STO + 1 takes 3 bytes.
  9. You can step-execute your code one line at a time while debugging, and you can goto a label while editing.
  10. SIN/COS/TAN for you engineers.
  11. The ARM is FAST!!

#3

Hi Don,

Yes indeed. I'm currently working on a few 30b sample programs to illustrate the programming capabilities for an article in HPCC Datafile.

Although the program capability is described as "macros", the machine is nevertheless quite capable as a programmable device.

As you've mentioned, the ace in the pack is the raw speed of the machine and the availability of scientific functions. so i'm hoping to come up with some examples for the 30b that simply are not feasible for other HP models.

I do think this machine represents capability that's been lacking for some time, and i'm very pleased to see it. the 35s got reception but, for me, this model is superior.

happy programming!


#4

Quote:
Although the program capability is described as "macros", the machine is nevertheless quite capable as a programmable device.

I agree, Hugh, it is. The prime factor example Gene listed demonstrates that, and it is fast.

Here is what the programming overlay looks like. Top quality all the way, they did a great job.

#5

Quote:
Conditionals, 6 of them. This will take some getting used to for the RPN programmer, because they don't work like other RPN programmable calculators. ?< means y<x here, not x<y. You'll have to be careful when adapting code from other calcs to the 30b. These tests don't use the traditional "do if true" rule; they use GotoT and GotoF based upon the condition code set by the conditional statement and placed on the stack. GotoT and GotoF pop the condition code off the stack before transferring.

Ooh, I like. This is actually more like how the RPL machines behave.

I was a little worried when I read the marketing brochure talking about "macros", but it looks like this will be just as programmable as any other machine. I'll be getting one for sure.

Now I wonder if they'll do a scientific on this 'Neo-Pioneer' architecture...

#6

Don,

Good list!

Let me add a bit....

0. It's not pure RPN, so that you need to Enter a number to get it onto the stack, same as you would for RPL. For example: 3 Enter x multiples whatever was previously in X by 3, or you could simply do: 3 x, but to get 3 squared you'd need: 3 Enter Enter x.

8. ..... Other commands like: Lbl, GTO, GF, GT, Call, Disp take two byes. Effectively the calculator allows for about 150-200 program lines.

-Katie


#7

Here's the N-Queens benchmark for the 30b. Run time is about 11 seconds for this totally non-optimized program when running in Prog slot 0. See Pascal's Benchmarks for many other examples

RCL Mode -- get the mode pseudo register
STO 9 -- and save it for later restoration
3
0
0
STO Mode -- set 0 RPN mode and 0 decimal places
8
STO 1 -- 8x8 board
0
STO 2 -- X value in grid
STO 3 -- number of solutions counter
STO 4 -- Y value in grid
Lbl 00
RCL 2
RCL 1
?=
GT 04 -- go if done
1
STO + 2
RCL 2
STO 0 -- set the X index into the Data array
RCL 1
STO Data -- store N in Data[X}
Lbl 01
1
STO + 3
RCL 2
STO 4
Lbl 02
1
STO - 4
RCL 4
GF 00
RCL 4
STO 0
RCL Data -- Data[Y]
RCL 2
STO 0
Rv (roll down)
RCL Data -- Data[X]
-
Input (i.e., Enter)
GF 03
Math
Down
Down
Down
= -- this is ABS (yuk)
RCL 2
RCL 4
-
-
GT 02
Lbl 03
RCL 2
STO 0
RCL Data
1
-
STO Data -- Data[X]-1 --> Data[X]
GT 01
1
STO - 2
Gto 03
Lbl 04
RCL 9
STO Mode -- restore the original mode
RCL 3
Stop

120 bytes
246 checksum

-Katie

Edited: 11 Jan 2010, 11:15 p.m.


#8

Hi Katie, I've added your result to the list.

Thank you for your effort.


#9

From the articles list, the ONLY HP calculators that do this benchmark faster are:

the HP 48GX, 49g, 49g+, 50g in various C or compiled code

and

The HP 200lx in various setups.

Can anyone tell that I'm impressed? Lol.


#10

You seem to forget the 41...


11.0 HP-41CX Assembly / NUT @ 0.35 MHz.
Greetings,
Massimo

#11

Ah, I said "faster" :-) Not "as fast". I saw the incredible timing using assembly on my favorite machine. Sadly, I can't program it myself in assembly. ;-)

And, I also saw the 12c+ time of about 23 seconds. I'd be shocked if the time could be cut in half.

The 30b CERTAINLY seems to be the fastest HP calculator on this test when programmed in normal user code.


#12

Sure! But that's on a 355 KHz CPU in a 30+ y.o. architecture... ;-)

Greetings,
Massimo

#13

The HP-12C+ is actually listed with ~23 seconds. Probably the 12C+ is even faster than the 30B with a small modification of the test code.


#14

Actually, I tried that modification and it's still 23 seconds. I was really trying to imitate the benchmarks program you listed not optimize them. I could speed up the 12C+ a little as well as the 30b with reprogramming.

There are a lot more options as to how to program this on the 30b so I'm sure it will beat the 12C+ for this benchmark and many others, but not everything. For example, sequential access to the cash flow registers are much faster on the 12C+ because of the auto increment/decrement of the register pointer and the time needed for branches is much more consistent and potentially a lot faster on the 12C+ depending on how the code is arranged on the 30b.

They are both extremely fast calculators.

-Katie

Edited: 12 Jan 2010, 6:21 p.m.


#15

The same speed of the modified code is surprising. Thanks for the verification.

#16

hello,

a trick, to run it faster... set the calculator in test-system mode and then set the slow clock to 25000. then redo your test... I am sure that we can smoke more calcualtors this way...

cyrille


#17

This speed gain is pretty modest a bit more than 1 second faster but the cost in battery life if you forget to take the system out of test mode is very large. I don't recommend using test mode -- unless there's some really good stuff in there that we don't know about yet!

-Katie

Edited: 13 Jan 2010, 9:29 p.m.

#18

Then the 30b has effectively twice the memory of an 12c (Non-platinum).

Regarding the new GT and GF commands, I do not recall seeing them on the 50g. If they wanted the programming to be closer to RPL, couldn't HP just have IF-THEN-ELSE-END structures?

In any case, the 30b is going to be my birthday present. :)

Edited: 12 Jan 2010, 9:45 a.m.


#19

I think the best explanation I've seen regarding 20/30b operation comes from Gene(?) that they are an RPL machine with a 4 level stack. Programming was really designed to be able to use the solver and to pull your commonly used commands onto keys. Of course, everyone wasn't happy with just that so. . .


TW


#20

Key thought: Always remember that this is essentially a macro capability with lots of nice programming features added in. That allows you to do some amazing things...

700 digits of PI computed VERY fast.
N-queens problem solved faster than ANY other HP except the 50g and 200lx. Wow.
Prime factor program, base 2-10 conversion program, lunar lander program, number guessing program, etc.

But, you will run out of space with only 290 bytes available. Trade offs.

Hopefully, the verdict will be that these trade offs work. I believe those who have used it already would answer: "YES".

It is a fun machine to use. Very nice financial features. Programmable in a much more useful way than the 12c.

Edited: 14 Jan 2010, 4:32 p.m. after one or more responses were posted


#21

Gene's right. But, frankly, what would be the appeal if all it could do was record keystrokes and play them back? That's boring, and it limits you to financial functions only (yes, I know it's a financial calculator, but I can ignore all those financial keys and assign cool programs to them anyhow!). The beauty of the way it turned out is that you can do what YOU want it to do, whether that's something financial, number theory, games, or just experiment around and have some fun. You couldn't do that with a macro program only.

And yes, I am VERY happy with the way it turned out. It can be whatever you want it to be, limited only by your imagination (and 290 bytes!).

Don

#22

Quote:
If they wanted the programming to be closer to RPL, couldn't HP just have IF-THEN-ELSE-END structures?
How to access all the keywords in an acceptable way? The LCD is not much of help here.

I like structured languages, even OO, when I have a keyboard and some space for a backup ;-).

#23

A good keyboard, native ARM code, keyboard overlays, it sounds like HP is really heading in the right direction here.

If/when they do a scientific calculator like this, I just hope that they add more programming space and a USB interface. 32k of programming space isn't useful if you have to enter the programs by hand.

Nice job HP!


Possibly Related Threads...
Thread Author Replies Views Last Post
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 245 12-04-2013, 11:14 AM
Last Post: Barry Mead
  Flashing cable for HP 20 / 30B Stefan Koenig 3 257 09-19-2013, 05:53 AM
Last Post: Marcus von Cube, Germany
  Any 30b cables left? patryk 7 345 09-16-2013, 02:54 PM
Last Post: Marcus von Cube, Germany
  HP-30B (WP-34S) Technical Documentation Barry Mead 3 218 09-09-2013, 03:07 PM
Last Post: Harald
  HP's thinking behind the 20b/30b? John Ioannidis 3 241 09-07-2013, 10:21 AM
Last Post: Tim Wessman
  30b/34s interfacing? ross sponholtz 5 273 06-26-2013, 01:41 AM
Last Post: Walter B
  Inexpensive HP 30b Matthew Richards 23 808 05-22-2013, 10:10 AM
Last Post: Dave
  hp-30b with free shipping sjthomas 9 438 04-14-2013, 02:46 AM
Last Post: Gerson W. Barbosa
  Amazon offering 8$ for my HP-30B Siegfried (Austria) 7 357 04-13-2013, 04:38 PM
Last Post: Chris Smith
  That is how they should sell the HP 30B :) Harald 11 461 04-07-2013, 11:44 AM
Last Post: Juergen Keller

Forum Jump: