35s, Global Labels, and GTO a program line from RUN mode



#14

I must admit I felt a twinge of disappointment to learn the 35s accommodated only 26 single character global alpha labels. I thought that this meant that only 26 user programs could be in the calculator at any one time.

On reflection I would like to suggest that the limitation is actually on the number of globally labelled program GROUPINGS, and that more routines than the limit of 26 are attainable are with a little ingenuity and admittedly a little hassle at the keypad.

For example, say that within the program grouping A there exist several smaller subroutines that function as programs in their own right, each ending with a RTN. Let's say one of them starts at step A025. Now lets assume the calc is in "run" mode. Is it not feasible to execute this subroutine directly as one can similarly on the 12c, with the keytroke sequence GTO .A025 R/S? Better yet, is it feasible save a few strokes and type XEQ .A025 directly in run mode? I hope that either of these strategies would execute the desired subroutine and stop at the appropriate internal RTN.

Gene, do you have any idea whether this is possible? It sort of is on the 33S, but since you need lettered labels even for internal branches and loops the strategy is pretty useless there. On the 35S it could be a great way to pack in lots of little programs. Of course, one would have to document their locations, etc.

Many thanks,

Les

Edited: 13 July 2007, 3:59 p.m. after one or more responses were posted


#15

Quote:
For example, say that within the program grouping A there exist several smaller subroutines that function as programs in their own right, each ending with a RTN. Let's say one of them starts at step A025. Now lets assume the calc is in "run" mode. Is it not feasible to execute this subroutine directly as one can similarly on the 12c, with the keytroke sequence GTO .A025 R/S? Better yet, is feasible save a few strokes and type XEQ .A025 directly in run mode? I hope that either of these strategies would execute the desired subroutine and stop at the appropriate internal RTN.

Both strategies appear to work (GTO A025 R/S and XEQ A025); I just tried it.

#16

Hi. If you pull down the learning module showing the indirect register packing program, you'll see how this is used. The main store/recall routine starts at step 001, but the initialization routine starts at step 070.

There's also a program example of an indirect register sort routine in the main indirect register learning module. Granted, it is pretty bad as a sort goes, but hey...time was short!

Basically, the answer is yes, but I think it is a bit easier than you show.

The Matrix Utilities program to soon be published in Datafile has instructions like this:

"2 ) To execute routine “M1” – to interchange two rows, key the two row numbers (order is unimportant) into X and Y and press XEQ M001 or XEQ M ENTER. No stack registers preserved."

and

"3 ) To execute routine “M2” – to multiply row “i” by the constant “k,” key “k” ENTER “i” and press XEQ M037. No stack registers preserved."


You do not need to type a decimal point if you wish to begin execution at a line number. No need for GTO . A025 R/S. Just type XEQ A then fill in the step prompt with 025 and execution will begin at program A, step 025.

The XEQ A ENTER shortcut was a good compromise rather than having to type XEQ A001 every time you want to start at step 001. At least, I hope people think that!


What I envision as one possibility is that a user might dedicate a label to be nothing but subroutines! Simply keep a list of where they start handy. Need another subroutine? Add it to the end of LBL S (for subroutines). Seems to work ok for me.


#17

Happy me!

The 35s isn't available yet here in Canada, but my favourite distributor will have it and will get one too me soon. It may be a bit overpriced compared to the US MRSP, but not nearly as much as it will be in the UK and EU.

Les

Edited: 13 July 2007, 4:01 p.m.


#18

Please Les.

Could you tell me where to buy a 35s here in Canada or who is this distributor? Thanks in advance.

Miguel Toro


#19

Larry at auctions@techcomm.ca. He is in Oakville, Ontario. Tell him I sent you!


#20

Thank you! I'll do.

Salut! :-)

#21

You know this may be a reasonable combination of features--one can have in the same calculator something akin to the GSB line number of the 33E/C, and the GSB label we are well used to in the 11C/15C/33S/32sii/34C/etc.

Les


#22

It's actually very similar to the never released 95c.

95c

#23

Gene - I guess the 'renumbering' doesn't work across global lables?
If program A contains a step GTO B123, and I add a line in program B *before* line 123 - is the reference in program A still updated?

Even if it is, it would make sense to have (say) label S set aside for Subroutines, in a table fashion:

S001 GTO S020 /* first subroutine */
S002 GTO S110 /* second subroutine */
S003 GTO S153 /* and so on */
..
S020 <first subroutine>
..
S110 <second subroutine>
..
S153 <third>

Then you can call them using XEQ S001, XEQ S002 etc from other global labels.
That way, you'll never have to remember the exact (often changing?) line number your subprogram currently starts from.

Cheers, Werner


#24

Actually, the renumbering works across all labels. It really is VERY useful.

Example:

LBL A

GTO B005

RTN

LBL B

ENTER

ENTER

ENTER

1/x

RTN

and then you insert a SIN instruction before the previous B005 line 1/x.

The original LBL A instruction of GTO B005 is dynamically changed to GTO B006.

The HP 35s really does have a lot going for it.

And, I like your suggestion for structuring a subroutine global label better than I had done. It is certainly better to remember XEQ S002 than XEQ S058 or such.

I really think that a global label devoted to nothing but subroutines is in the future of serious programmers' HP 35s.

Great idea! and Great Job HP! (IMO, of course).

#25

Quote:
Even if it is, it would make sense to have (say) label S set aside for Subroutines, in a table fashion:

S001 GTO S020 /* first subroutine */
S002 GTO S110 /* second subroutine */
S003 GTO S153 /* and so on */
..
S020 <first subroutine>
..
S110 <second subroutine>
..
S153 <third>

Then you can call them using XEQ S001, XEQ S002 etc from other global labels.


I too thought of this scheme and also an extension whereby the gotos are labelled with an equation on the previous line. I.e. you goto the initial even numbered steps of S and the previous odd steps include short descriptions of what each does. Helps jog an aging memory :-)


- Pauli

#26

If you're going to store matrices in a general way in the indirect registers, it may be best to store a 'descriptor' of some kind (eg a 3D vector holding the number of rows, columns, and a status indicator (LU decomposed or not, matrix 'packed' or not, real/complex.. )) *after* the matrix data, to prevent the automatic reclaiming of trailing zeroes.

Werner


Possibly Related Threads…
Thread Author Replies Views Last Post
  Integration question and "RPN" mode comment Craig Thomas 16 5,948 12-05-2013, 02:32 AM
Last Post: Nick_S
  HP Prime: Recommendation for future RPN Program Mode BruceTTT 3 2,207 11-13-2013, 10:03 PM
Last Post: BruceTTT
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,767 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Line Print Les Koller 6 2,493 11-11-2013, 09:38 AM
Last Post: Geoff Quickfall
  HP PRIME: Hide return value from program and swap Edit with Run vrrr 2 1,572 11-09-2013, 04:04 PM
Last Post: vrrr
  Program to change entry mode on Prime Michael de Estrada 3 1,979 10-28-2013, 10:13 AM
Last Post: Han
  Line number in Prime program listings Harold A Climer 3 1,941 10-27-2013, 03:37 PM
Last Post: Les Koller
  Prime: Exam mode (possible duplicate after funny response first time) Paul Townsend (UK) 1 1,519 10-24-2013, 03:09 PM
Last Post: Tim Wessman
  Does RPN entry mode cause the Prime keyboard to lock up ? Michael de Estrada 14 4,889 10-22-2013, 06:27 PM
Last Post: John Colvin
  HP Prime: Edit integer in RPN mode plivesey 15 5,076 10-18-2013, 04:34 PM
Last Post: kris223

Forum Jump: