M A R C H 1 9 8 8 H P - 2 8 N O T E S Wlodek Mier-Jedrzejowicz THE NEW MODELS!!! At last the HP-28S has been announced in the UK. As an added bonus, there is also the HP-27S with fewer features but at a much lower price, although it is an algebraic notation calculator. As you can read elsewhere in this DATAFILE, the HP-28S has more features than the HP-28C, yet it costs as much as did the HP- 28C. I won't go into too much detail of the HP-28S here beacause details are given in the reviews, but it is important to note that programs written for the HP-28C will also work on the HP-28S. In fact the HP-28S is an upgrade of the HP-28C in much the same way as the HP-41CX is an upgrade of the HP-41CV. I mention all this because it means that programs from previous months' HP-28 NOTES will work on the new model, and HP-28C owners will still find things of interest to them in future columns. FOR THE AVERAGE USER The average user (a concept as mythical as the unicorn, but even more useful) will probably find that the extra memory and speed of the HP-28S are the most helpful features. Entering programs and data will be as tedious as ever, but there is enough room that they can all be kept in the HP-28S, and the user does not have to keep purging things and then typing them back in again. As I wrote last month, it would take hours to enter a really large matrix, but HP-28S users will be able to do problems which themselves generate large matrices or long algebraic expressions. Given the larger memory, it will be possible to create dozens of user variables, so the "CUSTOM" and "MEMORY" menus will be important tools. Owners of HP-28Cs will no doubt be upset that the original model did not provide such tools. They can be cheered up by the fact that some of the new features can be created on the HP-28C by use of SYSEVAL. For example, the MENU command in the HP-28S is exactly the same command as I described in last December's DATAFILE for HP-28C users. The underlying tools for it are provided in the ROM-based procedural language of the HP-28; I found how they could be used to create MENU and clearly the HP-28S design team had the same idea. The SYSEVAL command is available on the HP-28S, so we can examine the structure of other CUSTOM and MEMORY commands, then reproduce them on the HP-28C if there is enough memory. So, don't sell your HP-28C just yet, or if you are offered an HP-28C cheap by someone buying an HP-28S then do consider buying that instead of an HP-27S. FOR THE ENTHUSIAST Mention of SYSEVAL brings me to the enthusiasts who will want to dig for new treasures in the HP-28S. One point to note is that my original PEEK and POKE programs will still work. The only thing that needs changing is the position of the top of memory - where PEEK (see V6N6p40) had 4FFFF as the top of memory, users of the HP-28S will have to replace that with 5FFFF, since the HP-28S has 32K of user memory instead of 2K, and the top of that user memory is now at address #5FFFFh. By the way, from now on I shall use the HP-28S method of writing binary integers with their base (h, d, o or b) at the end - users of the HP-28C should just make sure that their 28 is set to the appropriate number base. Back to PEEK; 4FF appears in it in three places and HP-28S owners should replace it with 5FF in all three places. The code in the HP-28S must have been rearranged considerably to provide all the new functions, for example the ability to copy the display into a text string and to do binary operations on such strings must have taken up close to 1k of ROM. The only way to provide the extra memory would have been to use a better "compiler" to produce the HP-28S internal code. One obvious improvement was to replace the 11 nibbles which marked the end of every subprogram with a 4 nibble GOTO - this one improvement should have provided about 2k of extra space. As I have just said in the case of MENU, the tools were already there, so a few k of memory saved will have provided the space needed for the extra features. Even though the instructions must have been moved around a lot, the addresses which point to the beginning of each instruction need not have moved, and SYSEVAL addresses which worked in the 1CC version of the HP-28C are likely to work in the HP-28S too in many cases. Try this with the clock to begin with! THE FACTORIAL FUNCTION Now for a snippet of equal interst to HP-28C and HP-28S owners. The factorial function N! is one function which has been written in reverse notation since long before the invention of RPN. After all, we were all taught in school to say "sine x" and write SIN(x), but we find nothing strange about saying "n factorial" and writing n!. Maybe we should use this example when extolling the virtues of RPN - most calculator users accuse us of being crazy, or at least perverse, in using reverse notation - we can reply that it is an entirely sensible alternative with a long tradition. Anyhow, since n! is a well-known notation, wouldn't it be nice and natural to write something like: << N ! >> in an HP-28 program? We already have the tools to do this since the normal way to do this is to write: << N FACT >> All we need to do is to rename the 'FACT' function so we can call it by the name '!'. First write the program << FACT >> and put it in level 1 of the stack. Now do: 33 CHR STR-> and you have the name '!' in level 1. Just press STO and you have a new variable called '!' which executes the program << FACT >>, and you can use it exactly as described in the program above. Try it - go to the USER menu and press 6! As I mentioned in V6N8, you can save some space by storing FACT without the program brackets (called French quotes by the HP-28 design team) around it. Graeme Cawsey has promised to write an article about this trick, so I'll mention only one more point about it. If you create a variable which contains a single command stored like this then you can VISIT or RCL the variable contents as expected, but if you try to print the variable by using PRVAR then the printer will show "System Object". Clearly the designers did not fully plan for this to be used in everyday work. WHAT ABOUT THE HP-71? What with all the fuss about the new calculators, Hewlett Packard seem to be relegating the HP-71B to some dark corner of their empire. This seems to be grossly unfair - the HP-71B is the direct predecessor of all these new calculators, since it introduced the Saturn CPU onto the scene. The "clamshell" or Champion series (HP-18, HP-19 and HP-28) and the Pioneer series (HP-17 and HP-27) are both derived from it. As far as the hackers are concerned, it was the HP-71B IDS that gave us the clues we needed. The HP-71B is still by far the best truly handheld BASIC language computer and instrument controller on the market - but HP steadfastly refuse to advertise it, so it is not sold, so its price remains high - CATCH-22! Maybe HP will finally produce a successor - since they are naming their handhelds after American spacecraft sent to Jupiter (Voyager for series 10, and now Pioneer for the 17 and 27), maybe the HP-71 successor will be the mythical Galileo, to be launched as late as the spacecraft of the same name. But that's a different story.