The Museum of HP Calculators
HP Forum Archive 16
[ Return to Index | Top of Index ]
|HP16C: Retrieving WSIZE (and a note about CCD ROM)|
Message #1 Posted by Vieira, L. C. (Brazil) on 7 Aug 2006, 10:26 a.m.
Hi, HP16C enthusiasts.
When I bought an HP16C in the 80's I read the entire manual contents and tested all examples. Then I tried my own programs and found that there was no direct way to retrieve current WSIZE to X-register (or any other), although it could be checked through [f][STATUS]. So I wrote the following program:
[g] LBL 0
[g] LJ counts how many bits are necessary to justify #1
x<>y this and next step are used to place #1 in the X-register...
[f] RL ... and preserve at least two previous values in stack
+ current word size
It works fine and returns current word size despite of the current base and representation mode. Anyway, I always felt it could be smaller and with a different approach. After delving a bit with the CCD ROM functions designed for binary integer operations, I tried to replicate some of the HP16C features and found a better way to retrieve WSIZE to the X-register in the HP16C with three program steps only, LBL and RTN not counted.
[g] LBL 0
0 (or [g] CLx if you want to overwrite X)
[g] #B the #B function does the trick
The CCD ROM note is about the way WSIZE is saved in the HP41, and chances are that this is well known to the 'in-deep' users reading this. I noticed that at least three registers in main memory (program memory) were lost everytime I worked with the CCD's features mentioned above. I used CCD´s 'B?' and noticed buffers #1 and #5 (maybe buffer #6, don´t remember correctly) were not cleared. After clearing both buffers I noticed that the borrowed registers were back to main memory. I also noticed that the highest numbered buffer amongst the ones mentioned above (#5 or #6; sorry not having an HP41 in hands right now) was used after setting word size, meaning that somehow the word size is stored there. Does anybody kow something about this? I did not read the CCD ROM manual yet, just the QRG, and I did not read 'MCODE for beginners' entirely yet. Do these documents have extra information about buffers? Any other documents I should look for?
Thanks for any information.
Edited: 7 Aug 2006, 11:27 a.m.
Return to Index | Top of Index ]
Go back to the main exhibit hall