HP-16C index register



#6

I remember reading speculations about the wordsize of the index register (68 bits) and what this bits are used for. Since there seem to be firmware emulators available for free, did someone check?


#7

At least Hewlett Packard list it as being 56 bits in the manual. But you are perhaps referring to undocumented extra bits?

Anders


#8

Hi, Anders;

in the other two Voyagers with index register (HP11C and HP15C), it is described as a 56-bit register. The HP16C also has an index register, but it is described as a fixed-size, 68-bit wide register, and it does not depend on current word size. I wonder if there is a way to check for this fact... Maybe, with WS=64d, perform [0][NOT] [STO][I] and then perform [ISZ] in a running program and see if [I] goes to zero (ISZ returns true) or if it goes to 010000000000000000h (ISZ returns false). Has anyone tried something?

The 68-bit wide Index register in the HP16C is clearly stated in the HP16c Owner´s Manual.

Cheers.

Luiz (Brazil)

Edited: 14 Feb 2006, 7:24 p.m.


#9

Hi!

I read something about this at http://www.finseth.com/hpdata/hp16c.html

But since Nonpareil is available, why not dump the memory and find out? (I must admit I have an old version installed without voyager support).


#10

HI, Klaus;

I´ll try this myself and let you all know here. I own two HP16C units, one is earlier and the other is newer, meaning internals are different. I think the test is simple, but I´d rather have it done in the calculator.

About dumping the ROM contents, it seems to me that it has already been done. I remember that sometime ago I read that one HP16C had one of its IC´s terminal broken after such dumping procedure. Too bad, though! Maybe someone else knowqs more about this.

Hrast has a Voyager emulator for the HP48/49 series, maybe the HP16C code is also available somewhere else.

Cheers.

Luiz (Brazil)


#11

Quote:
Hrast has a Voyager emulator for the HP48/49 series, maybe the HP16C code is also available somewhere else.


See (6) all way down the page

Greetings,
Massimo
#12

Hi, all;

I wrote the following small routines in the HP16C:

LBL E
1
DSZ
R/S
CLx
R/S
LBL F
1
ISZ
R/S
CLx
R/S
The basic idea is somehow simple: if I-register contents crosses zero while executing any of the routines, 0 is return. Otherwise, 1 is return. I set the calculator to unsigned mode, HEX base, and WordSize = 64d.

First I tested with the following:

keystroke   display
0 [STO][I] [ 0 h ]
[GSB][F] [ 1 h ] as expected;
[GSB][E] [ 0 h ] also expected;
[GSB][E] [ 1 h ]
[RCL][I] [FFFFFFFF .h ]
[f][WINDOW]1 [FFFFFFFF h.]
[GSB][F] [ 0 h ] It seems fine... so far.
0 [NOT] [FFFFFFFF .h ]
[STO][I] [FFFFFFFF .h ]
[GSB][F] [ 1 h ]
Oops! If I is 64-bit long, a zero is expected here.
[RCL][I]     [       0  h ]
The actual [I] contents are 010000000000000000h, and not 0000000000000000h, so the routine returns '1' instead of '0'.
[GSB][F]     [       1  h ]
[RCL][I] [ 1 h ]
[GSB][E] [ 1 h ]
[RCL][I] [ 0 h ]
Oops! Again, [I] contents are now 010000000000000000h, so the routine returns '1' instead of '0'.

Do you, guys, agree with the test and conclusions? Any comments?

Cheers.

Luiz (Brazil)


Edited: 16 Feb 2006, 1:32 a.m.


#13

Hi Luiz,

Very nice test program. Unfortunately I can't see a real application where the extra bits can be used.

By the way, is it true that the GSB(i) routines exist?

Greetings! Klaus


#14

Hi, Klaus:

Klaus posted:

"By the way, is it true that the GSB(i) routines exist?"

    Yes, and it is perfectly documented in the manual. The correct names are:
             GTO I
    GSB I
    and work as expected. Indeed, I did use GTO I in my recent "Long Live the HP-16C!" Datafile article.
Best regards from V.
#15

Hi, Klaus;

you are right in your concerns, I think I understand. Anyway, I guess that the main fact here is to be aware of these facts and the consequences of using the index register in some applications where its contents might cross 'zero' and they actually don't. If you write a program where it's expected that the [I] register has its contents crossing zero for a given number of bits, mainly the current word size, and you use ISZ or DSZ to detect such occurrence, it is a good idea to check if this is actually going to happen with the full extent of the [I] register.

If you have a device with an internal 32-bit register acting ass a counter and, at a certain point, its contents are FFFFFFFFh and you add one to it, its contents will be 00000000h and, if provided, a carry bit is set. If this register has its contents compared to zero at this point, test returns true. If you simulate the same circumstance in the HP16C and you decide to use the [I] register to do so, ISZ will cause the [I] register to go from FFFFFFFFh to 100000000h, so it returns false and the next step is missed. The same will happen if you are working with any other word size, no matter what.

So, ISZ and DSZ may be tricky in a few circumstances in the HP16C. I am not sure reading about such facts before, so maybe this is too rare to be considered a problem.

Hey, Valentim; thanks for your additional info. BTW, where can we download these masterpiecs of yours from? I remember trying some times when you announced they were available, but I got some error messages and did not succeed downloading. Now that I lost many important documents (every moment I remember something...), I am collecting good material again. Thanks.

Best regards.

Luiz (Brazil)

Edited: 16 Feb 2006, 1:37 p.m.


#16

I tried it yesterday, and apparently GSB(I) exists.

1 STO I
GSB (I)

Unfortunately my calculator already has some programs with labels in it, so I couldn't write a test program.
Maybe we are talking here again about a feature that has no practical value?


#17

Hi, Klaus;

I think that indexed subroutine call (GSB I) has its particular use when different handling is necessary depending on data value/range. I used this feature in claculators with larger memory, namely the HP41 and the HP15C, but I used it neither in the HP16C nor in the HP11C, although both share the GSB I feature. In the HP15C I remember writting a program (back in the mid 80's) to compute fluid flow in different tubbing, diferent diameter and shape. For each case a number (tubbing type code) was keyed in and the program stored it in [I] register. Then the corresponding subroutine was called with GSB I to adjust an specific index according to tubbing characteristics.

Cheers.

Luiz (Brazil)


#18

Hi Luiz,

I agree that you can do useful things with this indirection (like Polymorphism in C++ or function pointers in C), but I see no chance I will ever use it on the 16C. In fact I have great difficulties programming the voyagers without a manual, as the looping (DSZ,...) won't get into my head. Much less can I remember which value of I does what action (like branching backwards on the 67, referring to the Label "A","B",...)

While most functions on HPs are intuitive, I use hardly more than a fixed set of functions.

Without a manual, I am completely lost on topics like creating bitmasks with the 16C!

#19

I don't know that the high four bits of the 68-bit I register are used for anything whatsoever. It may have simply been easier to implement a 12-bit extension of the native 56-bit word than an 8-bit extenion, and not judged to be worth the trouble of masking off the extra four bits.

The high twelve bits of I are stored in nybbles 3 through 5 of RAM location 0xfe. I don't know if any of the other nybbles of that location are used; I've only observed zeros there. The low 56 bits of I are stored in RAM location 0xfd.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bought a 16C to compensate a little Eelco Rouw 23 8,223 12-07-2013, 01:26 PM
Last Post: Eelco Rouw
  Shiny new 16C! Keith Midson 7 2,673 10-27-2013, 02:22 AM
Last Post: Keith Midson
  Joys of eBay: HP-32S, HP-32SII, HP-42S, HP-16C, ... Sasu Mattila 7 2,602 09-23-2013, 04:39 PM
Last Post: Julián Miranda (Spain)
  Little curiosity: why the fourth stack register is called "T"? Antlab 34 8,899 07-03-2013, 04:49 PM
Last Post: Walter B
  HP-16C simulator fhub 12 3,618 06-30-2013, 10:14 PM
Last Post: Robert Prosperi
  Program for HP-16c... Leonid 9 3,258 06-07-2013, 08:51 PM
Last Post: David Hayden
  Another PPC DVD Update: 30th Year of Datafile + HP Conference Index Jake Schwartz 0 1,021 03-31-2013, 01:40 PM
Last Post: Jake Schwartz
  HP 11C/12C/15C/16C case Philippe Cairic 4 2,162 11-06-2012, 06:04 PM
Last Post: Matt Agajanian
  Understanding HP-16C integer division Jimi 18 5,334 10-16-2012, 09:13 PM
Last Post: Eddie W. Shore
  [WP34S] Register use by functions. Chris Tvergard 5 2,101 05-12-2012, 03:35 AM
Last Post: Walter B

Forum Jump: