The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

35s, Global Labels, and GTO a program line from RUN mode
Message #1 Posted by Les Wright on 13 July 2007, 2:22 p.m.

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

      
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #2 Posted by David Ramsey on 13 July 2007, 3:21 p.m.,
in response to message #1 by Les Wright

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.

      
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #3 Posted by Gene Wright on 13 July 2007, 3:36 p.m.,
in response to message #1 by Les Wright

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.

            
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #4 Posted by Les Wright on 13 July 2007, 3:58 p.m.,
in response to message #3 by Gene Wright

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.

                  
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #5 Posted by Miguel Toro on 13 July 2007, 4:07 p.m.,
in response to message #4 by Les Wright

Please Les.

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

Miguel Toro

                        
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #6 Posted by Les Wright on 13 July 2007, 4:21 p.m.,
in response to message #5 by Miguel Toro

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

                              
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #7 Posted by Miguel Toro on 13 July 2007, 5:39 p.m.,
in response to message #6 by Les Wright

Thank you! I'll do.

Salut! :-)

            
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #8 Posted by Les Wright on 13 July 2007, 6:49 p.m.,
in response to message #3 by Gene Wright

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

                  
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #9 Posted by Gene Wright on 13 July 2007, 7:22 p.m.,
in response to message #8 by Les Wright

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

95c

            
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #10 Posted by Werner on 17 July 2007, 4:07 a.m.,
in response to message #3 by Gene Wright

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

                  
Renumbering works *globally*
Message #11 Posted by Gene Wright on 17 July 2007, 10:09 a.m.,
in response to message #10 by Werner

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).

                  
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #12 Posted by Paul Dale on 17 July 2007, 4:43 p.m.,
in response to message #10 by Werner

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

            
Re: 35s, Global Labels, and GTO a program line from RUN mode
Message #13 Posted by Werner on 18 July 2007, 4:06 a.m.,
in response to message #3 by Gene Wright

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


[ Return to Index | Top of Index ]

Go back to the main exhibit hall