Poll: Which type of branching do you prefer?
Line Numbers (i.e. GTO 150)
Labels (i.e. LBL A, GTO A)
Both
Neither
[Show Results]
 
Post Reply 
Keystroke Programming: Labels vs. Line Numbers
11-04-2014, 02:07 PM (This post was last modified: 11-04-2014 02:10 PM by Eddie W. Shore.)
Post: #1
Keystroke Programming: Labels vs. Line Numbers
Which do you prefer:

Line Numbers (i.e. GTO 150)
Labels (i.e. LBL A, GTO A)

Or do you have a preference in keystroke programming?

HP calculators that use line numbers: 33C, 33E, 25C, 12C, 35S, 16C (?)
HP calculators that use labels: 33S, 32SII, 15C, 41, 42S, 35S
(yes 35S does both, not a typo)
Visit this user's website Find all posts by this user
Quote this message in a reply
11-04-2014, 02:45 PM
Post: #2
RE: Keystroke Programming: Labels vs. Line Numbers
Definetely, labels. They make much more easy to modify programs!
Find all posts by this user
Quote this message in a reply
11-04-2014, 04:22 PM
Post: #3
RE: Keystroke Programming: Labels vs. Line Numbers
Labels unless line numbers GTOs self modify during editing.
Find all posts by this user
Quote this message in a reply
11-04-2014, 04:44 PM
Post: #4
RE: Keystroke Programming: Labels vs. Line Numbers
(11-04-2014 02:07 PM)Eddie W. Shore Wrote:  Which do you prefer:

Line Numbers (i.e. GTO 150)
Labels (i.e. LBL A, GTO A)

Or do you have a preference in keystroke programming?

HP calculators that use line numbers: 33C, 33E, 25C, 12C, 35S, 16C (?)
HP calculators that use labels: 33S, 32SII, 15C, 41, 42S, 35S
(yes 35S does both, not a typo)

Are you serious?!? Wink

Labels, of course.

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
11-04-2014, 05:07 PM
Post: #5
RE: Keystroke Programming: Labels vs. Line Numbers
Labels, unless the number of labels is limited compared to the programming steps available.

That's one reason the 35S did labels and line numbers within labels (which idea I had a hand in, FWIW). The paradigm for single letter alpha labels could not be changed within the budgeted timeframe, but the suggestion of sightly modifying the GTO and XEQ instructions to allow for A003 as a destination could be done. The self-modifying nature of the code so that A003 would change to A004 in a GOTO if you added a step at A002, etc, was a suggestion I made that was readily adopted.

I believe it contributes greatly to using the 32K of ram much better than merely having 26 alpha labels would have.

Would expanded labels have been better than Label/StepNumber? Sure. As a compromise when that was not available, I believe still it was a very good choice.

All made very bad by the checksum bug which went unnoticed. I am really sorry to say that was right in front of some of us and we didn't notice it. For that, I really am still upset.
Find all posts by this user
Quote this message in a reply
11-04-2014, 10:00 PM
Post: #6
RE: Keystroke Programming: Labels vs. Line Numbers
Labels, all the way! I find the 12C painful to program, for just this reason. The shifting nature of line numbers requires a "two-pass" approach to writing and entering a program, which labels do not suffer from.

Even the 71B's BASIC, which supports line numbers - with automatic line renumbering - as a destination, also supports alpha labels. They convey more meaning, making them cognitively easier to deal with.

--- Les
[http://www.lesbell.com.au]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-04-2014, 10:32 PM
Post: #7
RE: Keystroke Programming: Labels vs. Line Numbers
My vote is label.
Labels are easier to deal with, when writing the program.
when the program is done/cleaned/debuged, line number is more efficient, but less readable.
aka wp34S

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
11-04-2014, 10:34 PM
Post: #8
RE: Keystroke Programming: Labels vs. Line Numbers
(11-04-2014 02:07 PM)Eddie W. Shore Wrote:  Which do you prefer:

Line Numbers (i.e. GTO 150)
Labels (i.e. LBL A, GTO A)

Or do you have a preference in keystroke programming?

HP calculators that use line numbers: 33C, 33E, 25C, 12C, 35S, 16C (?)
HP calculators that use labels: 33S, 32SII, 15C, 41, 42S, 35S
(yes 35S does both, not a typo)
16C is Labels !

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
11-05-2014, 05:09 AM
Post: #9
RE: Keystroke Programming: Labels vs. Line Numbers
Labels, for sure! Even HP-71 BASIC allowed GOTO labels because they are so much nicer than meaningless line numbers:

10 GOTO 'QUIT'
20 'QUIT': END

Silly example, but it illustrates the syntax.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
11-05-2014, 01:22 PM
Post: #10
RE: Keystroke Programming: Labels vs. Line Numbers
(11-04-2014 02:07 PM)Eddie W. Shore Wrote:  HP calculators that use line numbers: 33C, 33E, 25C, 12C, 35S, 16C (?)
HP calculators that use labels: 33S, 32SII, 15C, 41, 42S, 35S
(yes 35S does both, not a typo)

Some calculators that use both run programs faster with absolute addresses. When they execute GTO with a label, they have to search memory for the label.
Of course editing a program with labels is much easier since you don't have to manually adjust line number references.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
11-05-2014, 07:10 PM
Post: #11
RE: Keystroke Programming: Labels vs. Line Numbers
(11-05-2014 01:22 PM)toml_12953 Wrote:  Some calculators that use both run programs faster with absolute addresses. When they execute GTO with a label, they have to search memory for the label.

The HP-41 seems to record the address offset when it finds a local label he first time, and subsequent times run faster since it only has to verify that it's still there instead of searching again. You lose that benefit if you have something like GETKEY followed by GTO IND X, since it might jump to a different place each time the program is run. My first programmable was a TI-58c which had to search for the label every time, so I did try to write with step numbers when possible.

http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, http://wilsonminesco.com/links.html )
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2014, 07:43 PM
Post: #12
RE: Keystroke Programming: Labels vs. Line Numbers
The TI-95 gives you the best of both worlds. You develop the program using labels, and when you're done, there's a command that will convert all the branching instructions to absolute addresses to improve execution speed. There's also a corresponding command to reverse the process if you want to make further changes to the program. It's a pretty cool machine, despite the lack of RPN.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2014, 09:28 PM
Post: #13
RE: Keystroke Programming: Labels vs. Line Numbers
(11-06-2014 07:43 PM)Dave Britten Wrote:  The TI-95 gives you the best of both worlds. You develop the program using labels, and when you're done, there's a command that will convert all the branching instructions to absolute addresses to improve execution speed. There's also a corresponding command to reverse the process if you want to make further changes to the program. It's a pretty cool machine, despite the lack of RPN.
Would be nice to have the same functionality on the wp-34s

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
11-06-2014, 09:47 PM
Post: #14
RE: Keystroke Programming: Labels vs. Line Numbers
(11-06-2014 09:28 PM)patrice Wrote:  Would be nice to have the same functionality on the wp-34s

The 34S has variable length instructions so we can't just jump to an absolute address -- we'd have to search for the address from the beginning of program memory. This would almost always be slower than using a label.

Converting to BACK/SKIP is also a non-gain mostly. SKIP would be no faster since we're parsing each instruction skipped over. BACK might be a little faster but, I doubt it would be a noticeable difference in practice due to all the other overheads.

If you are so wedded to the idea of this conversion, download the 34S source code and implement it yourself Smile I am not going to since I don't see any utility in this operation. If I ever want a program with BACK/SKIP, which is rare, I use the assembler to generate the code for me.


- Pauli
Find all posts by this user
Quote this message in a reply
11-07-2014, 07:57 AM
Post: #15
RE: Keystroke Programming: Labels vs. Line Numbers
(11-06-2014 09:47 PM)Paul Dale Wrote:  If I ever want a program with BACK/SKIP, which is rare, I use the assembler to generate the code for me.

Things are a little different for ROM based programs. We call it XROM in the WP 34S. Since ROM based code doesn't change, we can precompute all jump targets. Furthermore, SKIP and BACK in XROM use absolute distances, not step counts. Of course no one ever performs these calculations manually. It's the assembler as part of the build process that does all the tedious counting for us.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
11-07-2014, 12:49 PM
Post: #16
RE: Keystroke Programming: Labels vs. Line Numbers
I use both a physical 35s, and Free42 on my phablet.

The labelling system used by the 35s (typical use LBL A, XEQ A, GTO A123) is simple and neat, and makes possible the construction of long complex programs.

The 42s/Free42 system is obviously more powerful as it allows three forms of label (local 2-digit numeric, local single-letter in ranges A..J and a..e, or multi-letter global), but in my view a bit scattered. Numeric labels can be easily confused with line numbers; single-letter locals are limited; and you just don't put global labels inside a program.

I don't expect computer-grade facilities in a calculator. Both the 35s and 42s offer good power in a traditional package. For anything more, I'll use a computer.
Find all posts by this user
Quote this message in a reply
Post Reply 




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