Hi Nina,
Quote:
maybe you consider this post from marcus: Re: HP-67 and TI SR-52 compared so a single digit becomes a label, two digits becomes an address, if followed by a non digit entry.
Yes, that's exactly how I think it works. But this does not quite match what you wrote: ;-)
Quote:
DSZ 0 ; go to label 0, create no error
DSZ 9 ; go to label 9, create error if not exist (unknown)
The labels are not named 0, 1, 2, ... 9 but 0', 1', 2' etc. Yes, the number keys can be used for labels, but they have to be entered with a preceding "2nd". This makes the difference between numbers and labels. So the stored code for label 1 is not 01, but 87 (key in row 8, column 7 = shifted column 2). This way the calculator can distinguish between a number 1 (code 01) and label 1' (code 87).
To make things clear, first let's take a look at the way it usually works. Let's assume the SR-52 comes along the code sequence 58 97. This in unambiguous:
58 => DSZ command.
Decrement R00 and, if not zero, branch to the target that follows.
97 => code > 09, so this is a label. Jump to label "LST".
That was easy. Another possible case: 58 01 07 05
58 => DSZ command.
Decrement R00 and, if not zero, branch to the target that follows.
01 => code in the range 00 to 09 => must be part of a line number.
Next code will be the second digit of line # 1xx.
07 => code in the range 00 to 09 => second digit.
Next code will be the third digit of line # 17x.
05 => code in the range 00 to 09 => third digit.
Now jump to line # 175.
And now for the essential point: Consider the code sequence 58 01 50 02. What will the SR-52 do now?
58 => DSZ command.
Decrement R00 and, if not zero, branch to the target that follows.
01 => code in the range 00 to 09 => must be part of a line number.
Next code will be the second digit of line # 1xx.
50 => oops... that's not within 00...09. So there is no three-digit
line number in the three steps following the DSZ command.
What will happen in this case?
In the message you linked Marcus says:
Quote:
If the command (SBR, GTO, if ...) is followed by a digit, two more digits are read and interpreted as an absolute address.
Fine. But what happens if the first code after DSZ (or SBR or GTO) is a digit 01...09, but the next one or two are not?
So my question is: how does the SR-52 react if, after the DSZ command, the first code that follows is within 01...09 (=> no label, must be part of a three-digit line number), but the second and/or third code is > 09, so that there are no three valid codes 01...09 that can form a three-digit line number
Final question:
Quote:
DSZ 99 ; go to line 99, create error if not exist
Is it really possible to enter line numbers with just two digits? If so, what happens if the two digits are, say, 1 and 2? How does the calculator know it has to branch to line 12 and not 123 or 129 or whatever code follows next?
Dieter