Professional Documents
Culture Documents
Sdiag 49G
Sdiag 49G
10
==================
The SDIAG library can be used to display stack diagrams of many UserRPL and
SystemRPL commands on the HP49G. The most convenient way to access the stack
diagrams is from within the Editor (e.g.from the command line) of the HP49G,
using Emacs commands. This is explained in the file Emacs.txt. Also, the
Nosy library provides a link to display stack diagrams of entries.
Introduction
------------
SDIAG is a library which contains the stack diagrams more than 4800 SystemRPL
commands, UserRPL commands and ML entries. The diagrams are distributed over
a large number of small and compressed files, so that accessing a specific
diagram is fast and needs little memory.
SDIAG contains two user level commands to display stack diagrams which can
also be used in programs.
The database is derived from the big entry database for HP48 and 49. The best
way to add entries to SDIAG is to add them to the big database and then
produce a new version of SDAIG.
If you would like to locally add entries to the database, you need to create a
variable "diagram". This variable must contain a single string with one-line
entry descriptions like the ones shown above. Different entries are separated
by NEWLINE characters. Note that you have to enter Greek mu and alpha and all
the other special characters as characters (using the CHARS command, for
example).
To save space, the stack diagrams in the database contain as little whitespace
as possible. Before they are displayed, they are formatted to look nice.
_________________________________
|DUP (SysRPL)|
|---------------------------------|
| 1 -> 1 1 |
| |
|______.____.____.____._____._____|
|CAS.H | >1 | >2 | >3 | ob? | OK |
------^----^----^----^-----^-----
- The ML cookie (Greek mu), the RAM cookie (Greek rho) and the CAS cookie
(Greek alpha) are removed.
- All occurrences of the arrow \-> will be aligned, and the lines containing
an arrow will as a whole be centered. For example
will be displayed as
_________________________________
|Lookup (SysRPL)|
|---------------------------------|
| ob test comp -> nextob T |
| -> ob F |
|______.____.____.____._____._____|
|CAS.H | >1 | >2 | >3 | ob? | OK |
------^----^----^----^-----^-----
_________________________________
|PushVStack&Keep (SysRPL)|
|---------------------------------|
| obn..ob1 [B] -> [B] |
|Virtual Stack: |
| -> [obn..ob1] |
|______.____.____.____._____._____|
|CAS.H | >1 | >2 | >3 | ob? | OK |
------^----^----^----^-----^-----
- If the stack diagram is wider than the screen, this will be indicated by
an arrow at the end of the line under the entry name, like in this example
for the unsupported entry ^Choose3Index (a "T" after the #idx is off the
screen).
_________________________________
|(^Choose3Index) (SysRPL)|
|-------------------------------->|
|meta $title #pos :handler -> #idx|
| -> F |
| |
|______.____.____.____._____._____|
|CAS.H | >1 | >2 | >3 | ob? | OK |
------^----^----^----^-----^-----
Menu buttons
============
The stack diagram display has a menu with the following options
>1 Cross reference to the first word in the stack diagram with
the cross reference cookie (character 86h) before it.
Additional keys:
----------------
Arrow keys: Scroll the stack diagram (if it is too large to fit on
the screen).
Other keys: Any other key exits as well (like the OK menu key).
Internal organization
=====================
SDIAG has separate files for each starting letter of command names. So
commands starting with "a" are in one file, commands starting with "A" are in
another. All commands starting with non-letters (like `!', `$' etc) are
lumped together in a single extra file.
Due to the organization of the command names some starting characters are
very frequent. For example, all FlashPointers start with "^" (there are about
1500 of them) and all UserRPL commands start internally with "x" (there are
hundreds of them). This would lead to a few extremely large files, an
unwanted effect. In order to balance the different files better, the
following steps were taken:
1. Extra files for entry names starting with `#' and `%' since these are the
most frequent non-letters.
2. All FlashPointers, RomPointers and User commands are filed under the
lowercase version of the first letter in the command name which is not `^',
`~', or `x'.
All User commands are filed under their name preceded with `x', even if there
is no SystemRPL entry with that name. For example, FOR is filed as xFOR, even
though xFOR is not a valid extable name.