Custom Menus on High-End RPL Machines
|
04-02-2019, 12:28 AM
(This post was last modified: 02-15-2020 01:56 AM by Giuseppe Donnini.)
Post: #1
|
|||
|
|||
Custom Menus on High-End RPL Machines
Given the recent interest in custom menus, it might be worthwhile to take a quick overview of the development, and continuous improvement, of the custom menu system on high-end RPL machines.
A. FIRST APPEARANCE : ORLANDO 1988 (HP-28S) The HP-28S's immediate precursor Paladin (HP-28C, 1987) didn't yet provide custom menus, though not due to an oversight on behalf of the development team (headed by Bill Wickes), but because it was not deemed worth the effort given the exceedingly small amount of RAM available to the user (2K). In fact, Bill Wickes was forced by HP managament to either wait a couple of years to build his symbolic "dream machine", or to do it on the pre-existing Champion hardware (HP-18C, 1986). Although the very first calculator to use the new RPL operating system (also developed by the same team), its OS was actually hidden under an algebraic user interface, and it had only 2K of RAM. This made sense for a business model, but would be severely limiting for an advanced scientific calculator of the kind envisioned by Bill Wickes. Nevertheless, he felt it was better than nothing, and accepted. Despite being "a crippled product in many respects" (quoting Bill Wickes himself), the HP-28C became a huge success, particularly in the mathematical community, and was able to finance its successor, the HP-28S, which was actually a complete redesign of the HP-28C. With sixteen times more RAM available to the user (32K), it was now possible to implement things conceptualized long before, like user graphics, sub-directories, and custom menus. Considering the complexity of the subject, the following discussion will limit itself to a particular aspect of the custom menu system, which best exhibits HP's continuous efforts to improve it, namely menu keys defined by global names. Given that restriction, the custom menu system as implemented in the HP-28S could be summarized as follows: OUTPUT CUSTOM MENUS (White on Black Labels) +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING [id] WITH OR W/O SHIFT: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) executes | | | the contents of the global variable named id. (*) | | | | | ALGEBRAIC | Echoes the string "id" (without quotes) to the command line. | | | | | ALPHA | Echoes the string "id" (without quotes) to the command line, | | | surrounded by spaces. | +------------+--------------------------------------------------------------+ (*) If the global name references a directory (whose label in the HP-28S still lacks the distinguishing tab), its execution consists of making that directory the current one. INPUT CUSTOM MENUS (Black on White Labels) +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING [id] WITH OR W/O SHIFT: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) stores the | | | object on stack level 1 in the global variable named id. (*) | | | | | ALGEBRAIC | Echoes the string "id" (without quotes) to the command line. | | | | | ALPHA | Echoes the string "id" (without quotes) to the command line, | | | surrounded by spaces. | +------------+--------------------------------------------------------------+ (*) If the global name references a directory, a "Directory Not Allowed" error is generated. We may note that:
B. MAJOR IMPROVEMENT : CHARLEMAGNE 1990 (HP-48SX) With one of the major design goals of the HP-48SX being enhanced customizability, it comes as no surprise that the custom menu system was greatly improved, merging the strengths of both output and input types into a single, unified structure: +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING [id] W/O SHIFT: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) executes | | | the contents of the global variable named id. (*) | | | | | ALGEBRAIC | Echoes the string "id" (without quotes) to the command line. | | | | | PROGRAM | Echoes the string "id" (without quotes) to the command line, | | | surrounded by spaces. | | | | | ALG + PRG | --- same as in ALGEBRAIC mode --- | +------------+--------------------------------------------------------------+ (*) If the global name references a directory (now displayed with the distinguishing tab), its execution consists of making that directory the current one. +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING LEFT SHIFT + [id]: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) stores the | | | object on stack level 1 in the global variable named id. (*) | | | | | ALGEBRAIC | --- same as in IMMEDIATE mode --- | | | | | PROGRAM | --- DEAD KEY (low beep) --- | | | | | ALG + PRG | --- DEAD KEY (low beep) --- | +------------+--------------------------------------------------------------+ (*) If the global name references a directory, a "Directory Not Allowed" error is generated. +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING RIGHT SHIFT + [id]: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) recalls | | | the contents of the global variable named id. | | | | | ALGEBRAIC | --- same as in IMMEDIATE mode --- | | | | | PROGRAM | --- DEAD KEY (low beep) --- | | | | | ALG + PRG | --- DEAD KEY (low beep) --- | +------------+--------------------------------------------------------------+ C. FURTHER REFINEMENT : HAMMER 1993 (HP-48GX) In the HP-48GX this scheme was further enhanced by placing additional typing aids on the dead key positions of the HP-48SX: +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING [id] W/O SHIFT: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) executes | | | the contents of the global variable named id. (*) | | | | | ALGEBRAIC | Echoes the string "id" (without quotes) to the command line. | | | | | PROGRAM | Echoes the string "id" (without quotes) to the command line, | | | surrounded by spaces. | | | | | ALG + PRG | --- same as in ALGEBRAIC mode --- | +------------+--------------------------------------------------------------+ (*) If the global name references a directory, its execution consists of making that directory the current one. +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING LEFT SHIFT + [id]: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) stores the | | | object on stack level 1 in the global variable named id. (*) | | | | | ALGEBRAIC | --- same as in IMMEDIATE mode --- | | | | | PROGRAM | Echoes the string "'id' STO" (without double quotes) to the | | | command line, surrounded by spaces. | | | | | ALG + PRG | --- same as in PROGRAM mode --- | +------------+--------------------------------------------------------------+ (*) If the global name references a directory, a "Directory Not Allowed" error is generated. +------------+--------------------------------------------------------------+ | ENTRY MODE | PRESSING RIGHT SHIFT + [id]: | +------------+--------------------------------------------------------------+ | IMMEDIATE | (If a command line is present, executes it, then) recalls | | | the contents of the global variable named id. | | | | | ALGEBRAIC | --- same as in IMMEDIATE mode --- | | | | | PROGRAM | Echoes the string "'id' RCL" (without double quotes) to the | | | command line, surrounded by spaces. | | | | | ALG + PRG | --- same as in PROGRAM mode --- | +------------+--------------------------------------------------------------+ D. CONCLUSION As is readily apparent from the above, the HP-48's custom menu system is vastly superior to that of the HP-28S, especially considering the fact that we only focussed on global names as menu key objects, leaving aside the two dozens other object types which may trigger their own menu key actions. But what's missing in the 48 are 28S-sytle input menu keys, with their inverted labels, and their ability to store values with a single, unshifted keystroke—while at the same time remaining completely disconnected from the Solver environment. Now, given the unrivalled flexibility of the 48, nothing prevents us from adding this feature ourselves! And while we're at it, we could even go a step further and combine the best of both worlds and have the new input keys retain their added, 48-specific functionality, albeit in a different distribution: unshifted keys would then store, left-shifted keys execute, and right-shifted keys recall the corresponding variable's contents. In short, we want 48-style variable keys, but with black on white labels and with their no- and left-shift actions interchanged. The skeleton of such a custom menu would look like this: { { :: TakeOver $ "A" MakeInvLabel ; ( *MENU KEY 1 Label Object* ) { :: TakeOver ' ID A StdMenuKeyLS ; ( *MENU KEY 1 No-Shift Action Object* ) :: TakeOver ' ID A StdMenuKeyNS ; ( *MENU KEY 1 Left-Shift Action Object* ) :: TakeOver ' ID A StdMenuKeyRS ; ( *MENU KEY 1 Right-Shift Action Object* ) } } { :: TakeOver $ "B" MakeInvLabel ; ( *MENU KEY 2 Label Object* ) { :: TakeOver ' ID B StdMenuKeyLS ; ( *MENU KEY 2 No-Shift Action Object* ) :: TakeOver ' ID B StdMenuKeyNS ; ( *MENU KEY 2 Left-Shift Action Object* ) :: TakeOver ' ID B StdMenuKeyRS ; ( *MENU KEY 2 Right-Shift Action Object* ) } } ( ... ) } ( StdMenuKeyRS is an unsupported, but stable entry point at #4021Fh. ) This code works equally well in an HP-48SX and in an HP-48GX, but the newly added typing aids of the GX will obviously not be available on an SX (although they can be added). In a thorough implementation, however, several things would have to be reconsidered:
With these improvements in mind, an input key in immediate entry mode would then have the following functionality (as usual, any pending command line is executed beforehand): +-------+ | NS | +-------+----------------------------------------------------------------------+ | [id] | + Stores the object on stack level 1 in the global variable named id | | | within the current directory. If the variable doesn't exist, | | | creates it in the current directory. If it already exists in the | | | current directory, its contents are overwritten with the new | | | object from stack level 1. | | | + If the storing operation was successful, displays a confirmation | | | message in the status area of the form "id: contents". | | | + If the object on stack level 1 is an unrooted directory, stores it | | | in the global variable id within the current directory, thereby | | | rooting it in the latter as its sub-directory. As a consequence, | | | the key label changes from black on white to white on black with a | | | tab, and the key actions revert to their standard behavior (as | | | long as the new sub-directory remains in the current path). | | | + The menu key offers the same protection as the STO key against | | | accidental overwriting of a variable (LASTARG returns the old, | | | rather than the new contents of the variable, so that the sequence | | | RS+ARG STO restores the variable to its prior state). | | | + If the object on stack level 1 is the same as id, generates a | | | "Circular Reference" error. | | | + If there is no object on stack level 1, generates a "Too Few | | | Arguments" error. | | | | | [dir] | + [Standard white on black label with a tab] Makes dir the current | | | context. Unlike in the VAR menu, dir may be anywhere in the | | | current path, as is the case for standard custom menus, too. | | | | | |......................................................................| | | | | [lam] | + Stores the object on stack level 1 in the temporary variable named | | | lam, overwriting the old contents. If the temporary variable | | | doesn't exist, generates an "Undefined Local Name" error. | | | + If the storing operation was successful, displays a confirmation | | | message in the status area of the form "lam: contents". | | | + The menu key offers the same protection as the STO key against | | | accidental overwriting of a variable. | | | + If the object on stack level 1 is the same as lam, generates a | | | "Circular Reference" error. | | | + If there is no object on stack level 1, generates a "Too Few | | | Arguments" error. | +-------+----------------------------------------------------------------------+ +-------+ | LS + | +-------+----------------------------------------------------------------------+ | [id] | + Executes the object stored in the global variable named id. The | | | search for id is not restricted to the current directory, but is | | | extended to the current path. If the variable is not found in the | | | current path, it is considered as not yet defined (formal variable)| | | and the global name 'id' is returned to the stack. | | | | | [dir] | + [Standard white on black label with a tab] Generates a "Directory | | | Not Allowed" error. Unlike in the VAR menu, dir may be anywhere | | | in the current path. | | | | | |......................................................................| | | | | [lam] | + Recalls the object stored in the temporary variable named lam to | | | stack level 1. If the temporary variable doesn't exist, generates | | | an "Undefined Local Name" error. | +-------+----------------------------------------------------------------------+ +-------+ | RS + | [N.B. All right-shifted menu keys retain their standard behavior.] +-------+----------------------------------------------------------------------+ | [id] | + Recalls the object stored in the global variable named id to | | | stack level 1. The search for id is not restricted to the current | | | directory, but is extended to the current path. If the variable | | | is not found in the current path, generates an "Undefined Name" | | | error. | | | | | [dir] | + [Standard white on black label with a tab] Recalls dir as an | | | unrooted data object to stack level 1. Unlike in the VAR menu, | | | dir may be anywhere in the current path. | | | | | |......................................................................| | | | | [lam] | + Recalls the object stored in the temporary variable named lam to | | | stack level 1. If the temporary variable doesn't exist, generates | | | an "Undefined Name" error. | +-------+----------------------------------------------------------------------+ E. PRACTICAL EPILOGUE In a bold break with tradition, I will not leave the implementation of such a menu system as an exercise for the reader, but rather offer my own try at it. Further details may be gleaned from the commented source code. Observations, suggestions, and criticism are welcome. Gaudete! Ex. Temporary custom menu for easy vector input with mixed input and output keys. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)