Hello Netland:

     The following is a collection of most of my HP28S' contents.  It's
purpose is four fold.

1)  To give novice net readers intimidated by the net system (and unsure
    how to get previous postings) a broad range of code and insight.

2)  To collect some of the better written code in one location.  (This is
    by no means complete!!!)

3)  To help spark life and evoke a response from netland's silent majority.

4)  I needed a hardcopy anyways for archival purpose.  (Catastrophe befalls
    even an HP occasionally)  Since this was originally written for
    personal archival purposes, much of the descriptions and code may
    appear terse (sorry).

**************************************************************************
*    Aaron Dinwiddie                                         1/19/90     *
*    HP_ToolKit v1.0                                                     *
**************************************************************************

WARNING:
    The following programs are written for the HP28S (v.2BB).  Damage or
memory lost due to use of such programs is your own responsibility.


Directory               PROGRAM CHECKSUMS
--------------------------------------------------------------------------
HOME       SON     D67E     SYS     6203     SPCD    316B
           SOFF    D7BA     FLIPL   A74D     OFF     6E03
           FAST    C062     CD      55A3     SHFTON  5E2D
           CHKSUM  21D1     MV      268B     SHFTOFF  E2D

->PG1      GETP    1EC7     IN       356     LROR    303D     CDISP   6943
           PUTP    4C32     IN2     56B5     LDISP   3EC8
           RDIR    2C8D     LROL     EE2     LDP     5EFB

->PG2      SOLVE   9EE7     PEEK    22F7     HP->S   5F39
           PEEK2   4761     FIND    98FF     RAM     CD9F
           FIND2   8E4B     S->HP   60F0

->PG3      DX      F2CA     DOWN    97D3     PURG    8AC1     MULTI   8098
           MVUP    5ACE     YKEY    FFB9     S->N    3960     DEL*    347C
           UP      A194     VER     B851     N->S    2FDE     DELX    93AB
           MOVE    FE34     ERA     3D65     EXCO    799E

->PG4      CLOCK   C2BD     TM      5A2F     JC2     5E06     MTHLST  66D5
           CAL*    C603     FMTTIME 5ACF     CJ2     CF65     DM      4247
           DCAL    6912     FMTDATE 57B8     DOW2    6174     TMSTMP  59DA
           SETTIME CEB3     JC      EEA3     DAYS    3ADB     CKOR    var?
           SETDATE 6138     CJ      B4B4     NDAYS   F062     DKOR    var?
           TIME    A651     DW      7A7E     MTHS    4398
           DATE    FD70     DOW     34F7     CAL     EE76

->PLT      PLOT    8B67

->PHN      PFIND   216D     PNEXT   C745     LSTR     7E2
           PNADD   48D9     PGET    3214

->STAT     SORTS   582C     SORTA   EE10     MXMN     AB86


DIRECTORY STRUCTURE:                       All directories begin with ->
                            HOME       to aid in distinguishing directories
                             |         from variables and programs.  Also,
                           ->PG1       directories are always the first
                             |         item in a directory.
                           ->PG2          (See comment on old FAST prog)
                             |
                           ->PG3
                             |
                           ->PG4
                             |
                           ->PG5
       ____________________/_|_\_____________________
      /      /     |      |      |      |      \     \
    ->WK  ->BIN  ->PLT  ->PHN  ->FIN  ->STAT  ->EE  ->BAK


NOTE:

  *         == Degree symbol when appearing in list or variable names
  (d/dx)    == Partial derivative symbol
  (SIGMA)   == Greek letter Sigma
  <>, >=    == Not equal, greater than or equal, etc...

========================== PROGRAM DESCRIPTIONS ==========================
HOME Directory:
===============

     SON sysob turns the display on after being turned off with SOFF.


     SOFF sysob turns the calculator display off while leaving the
calculator on (saves batteries).


     FAST sysob speeds the HP-28S calculator up about 200% (Batteries are
consumed faster).


     CHKSUM takes a name of a program or variable off the stack and returns
a checksum for it.  TYPE THIS IN FIRST!!!


     SYS takes a string off the stack and creates a system object.  SYS is
needed for SON, SOFF, FAST, and PEEK.  Be sure that the string is correct as
that running an improper system object can trash memory!


     FLIPL flips a list on the stack, ie. { 1 A 2 B } ==> { B 2 A 1 }


     CD moves you to the directory previously accessed.  It works by
retrieving the current path from the global path variable PCD, storing the
current path into PCD, and then calling MV to move to the path on the stack.


     MV evaluates a list one item at a time.  By giving it a path such as
{ HOME ->PG1 ->PG2 }, each item is evaluated, effectively moving you to the
directory ->PG2.


     SPCD Stores the path of the current directory in the global variable
PCD in the HOME directory.  Your current directory is unchanged.


     DIR is a data structure used to hold my directory structure.  It will
be used by many other routines.


     OFF turns a version 2BB 28S off (check version before doing syseval!).
If this is executed from within a program, the program will resume upon
being turned back on therefore:

                      << 1 5 START OFF NEXT >>

will require the ON button to be pressed 5 times before turning on the 28S.
Password protection can be added to the 28S using OFF.


     SHFTON turns the shift annunciator on.  (One use is to use SHFTON and
SHFTOFF to indicate when a program is waiting for a key to be pressed).


     SHFTOFF turns the shift annunciator off.


->PG1 Directory:
================
     GETP gets all programs and variables from the current directory and
places them on the stack.  A list of the program and variable names is also
placed on the stack.  This program was written to be used with PUTP which
would allow me to quickly copy or move everything from one directory to
another.  For example, I may wish to add a directory ->PG6 after ->PG5 which
would require much work in reordering my directories.


     PUTP retrieves a list of variable names and programs off the stack and
stores them in the current directory.


     RDIR takes the leftmost variable in a directory and places it to
farthest right.  I wrote this because my directories are always the first
item in a directory and whenever I saved a variable this would get screwed
up.


     IN is equivalent to gets() in C.  A prompt string and the line display
level is taken off the stack a string is returned upon pressing the ENTER
key.  In addition, pressing the INS key while entering the string suspends
the programs and places you back at the command line.  Upon pressing the RED
key and then the CONT key, you resume entering your data.  A blinking
underscore will be your prompt.  To get the colon and underscore in the
program, first create two variables whose names are ':' and '_'
respectively, then pressing the variable name while writing the program will
insert ":" & "_" into the program.  See helpful hint #2.

Example:            You type    "Input X" 2 IN

                    results in,

                    +----------------------------------+
                    |                                  |
                    |Input X: _                        |
                    |                                  |
                    |                                  |
                    +----------------------------------+

                    pressing 123 returns "123" to the stack.


     LROL rotates a list on the stack to the left.


     LROR rotates a list on the stack to the right.


     LDISP takes a string and a number off the stack and displays the string
centered on the line specified.  The text is ORed with the current display
(See PLOT program).


     LDP similar to LDISP except that the text is left justified.


     CDISP takes a string off the stack, clears the first 3 lines, and
centers the string on line 2.


->PG2 Directory:
================

     SOLVE takes an equation, the variable of interest, and the order of the
equation off the stack and returns (hopefully) all the real roots of the
equation.  SOLVE is a generic and inefficient root solver, but is ok for
equations of less than fifth order with real roots.
      Example:    3:  '(X+1)*(X+2)*(X-1)'
                  2:  'X'
                  1:  3
      Returns:
                  3:  1
                  2:  -1
                  1:  -2


     PEEK is a sysob which takes a binary starting address and the number of
nibbles (in binary) to PEEK in memory.  The nibbles are returned to the
stack in a string (high and low order nibbles are reversed).

     Example:  2:  # C0000       Might return:   1:  "EF0794"
               1:  # 6
                   PEEK


     FIND takes a string and two binary numbers (start and ending address)
off the stack and returns a list containing the addresses in memory where
the string was found.  The string is in low/high nibble order (ie. to search
for the string "ABC", FIND would require the string "142434").


     Example   3:  "142434"            Might return  1: { #C023Fh }
               2:  # C0000h Start Ram
               1:  # D0000h End of Ram
                   FIND


     PEEK2 takes a binary starting address and the number of bytes (integer)
to PEEK in memory.  The bytes are returned to the stack in a string.


     FIND2 takes a string (ie "ABC") and two binary numbers off the stack
and returns a list containing the addresses in memory where the string was
found.


     S->HP converts a string (ie. "ABC") in a low/high nibble order string
(ie. "142434") usable by FIND.


     HP->S is the inverse of S->HP.


->PG3 Directory:
================

     DX sets up a custom menu of often used functions, the first item in the
menu is the last extension in the path name.


     MVUP moves up one directory.


     UP saves the current path, moves up one directory then invokes DX to
update the path in the current menu.


     MOVE prompts the user with a menu of possible directories, and pressing
the CONT key causes the program to move to that directory.

     DOWN prompts the user with a menu of directories directly below the
current directory.  The user must explicitly press the DX menu option after
pressing the desired subdirectory to update the menu.


     YKEY returns a 1 to the stack if the 'Y' key is pressed 0 otherwise.


     VER verifies a decision by prompting the user, default is no.  Upon no,
the program is terminated.


     ERA deletes all variables in a directory along with all subdirectories
and everything in those subdirectories.


     PURG takes a name off the stack and attempts to delete it.  If the name
is a directory name, everything in the subdirectory will also be deleted.


     S->N converts a string into a name, ie "AARON" => 'AARON'


     N->S converts a name into a string.


     EXCO and MULTI  expands and collects an equation as much as possible.


     DEL* computes the del dot product of the bottom three equations on the
stack.  Stack level 3 contains the x component while stack level 1 contains
the z component.


     DELx computes the del cross product of the bottom three equations on
the stack.  Stack level 3 contains the x component while stack level 1
contains the z component.


->PG4 Directory:
================

     CLOCK and all the other programs in that directory perform the function
of turning the HP28S into a clock and calendar.  This works by calling a
syseval at #4554d (version 2BB) which is a continuous counter register.  The
time and date is calibrated off the counter using the SETTIME and SETDATE
programs.

To set time and date to : 2:27.50 pm, Nov. 12, 1989

                    ENTER...  14.2750 SETTIME
                    THEN....  11.121989 SETDATE

pressing CLOCK yields

          +---------------------+
          |                     |
          |Sun, Nov  12, 1989   |
          |                     |  <- The time will continuously update
          |     2:27:50 pm      |
          +---------------------+

Press any key other than ON to restore display (Pressing ON leaves garbage
on the stack).

     CAL* displays a scrolling calendar of the current month.


->PLT Directory:
================

     PLOT is a program I wrote for plotting parametric equations.  I have
tried several methods of plotting programs such as plotting using the pixel
command while calculating but this appears to be equally fast and has
several major benefits.  I basically perform all the calculations first and
save the data into an array which is later displayed using the DRW(SIGMA)
command.  By using this method I can use the built in SCL command to scale
the data to fit the display.  Also by saving into an array, the graph can be
redrawn later possibly after rescaling without having to recalculate.  The
program will beep when it is finished.

When finished, be sure to delete the variable (SIGMA)DAT since it may be
consuming much memory.  Another option is to just type.. 0 '(SIGMA)DAT' STO
which will replace the variable with the value 0.  Doing this avoids having
the program create a new variable which clutters up the main menu.


->PHN Directory:
================

     PFIND prompts the user for a name (or part of a name) and attempt to
match the name to one in it's mini-phonebook.  If a match is found, the full
name and phone number is displayed.


     PNADD prompts the user for the name and phone number of a person to add
to the phonebook database.


     PNEXT searches for the next occurrence of a name.


     PGET does the work for PFIND and PNEXT.  It is not called by the user.


     LSTR takes a name or part of a name and attempts to find a match in the
database.  The location of the match is returned.


->STAT Directory:
=================

     These routines are not placed in ->STAT for any particular reason.

     SORTS takes a number off the stack corresponding to the number of
remaining numbers on the stack which are to be sorted.  The number are taken
off the stack, sorted, and stored in (SIGMA)DAT.


     SORTA sorts the numbers in (SIGMA)DAT.


     MXMN takes two numbers off the stack and returns the larger number in
level 2 and the smaller number in level 1.


MISCELLANEOUS ROUTINES:

     These are just different ways of doing things which I never deleted.
     COMP takes a number and returns the same number in the current base,
the one's complement of the number, and the two's complement of the number.


========================== PROGRAM SOURCE CODE ===========================


Home Directory:  VARS == { ->PG1 SON SOFF FAST CHKSUM SYS FLIPL DIR
===============            CD MV SPCD PCD OGET OFF SHFTON SHFTOFF }

To make system objects for SON, SOFF, FAST, and PEEK (later):
   1)  Type in the following strings with NO SPACES! and save in a temporary
       variable.
   2)  Triple check the checksums
   3)  Place the string on the stack and run SYS.  A "system object" will
       appear on the stack (2 for PEEK).
   4)  Save into a variable as usual.


    SON:    "69C20 32000 1331F 30FFF 30A15 D0133 14216 4808C"  ; no spaces!

   SOFF:    "69C20 32000 1331F 30FFF 30015 D0133 14216 4808C"  ; no spaces!

   FAST:    "69C20 32000 1331F 00FFF 30F15 D0131 14216 4808C"  ; no spaces!

 CHKSUM:    << RCLF STD HEX 16 STWS SWAP RCL ->STR DUP # 0d 1 ROT SIZE
               FOR j OVER j j SUB NUM R->B XOR RL NEXT ->STR 3 OVER
               SIZE 1 - SUB ROT STOF SWAP DROP >>

    SYS:    << "69A20" SWAP + "09F20" + -> LM
              << PATH HOME HEX "" 1 LM SIZE FOR I "#" LM I DUP2 1 + DUP
                 SUB 3 ROLLD DUP SUB + + STR-> B->R CHR + 2 STEP 'EXE'
                 DUP PURGE STO # D0000h EXE SIZE 2 * - SYSEVAL 1 GET 1
                 ->LIST LIST-> DROP 'EXE' PURGE SWAP MV >> >>

  FLIPL:    << DUP SIZE -> a
               << 0 a 1 - FOR j DUP a j - GET SWAP NEXT DROP a ->LIST >>
            >>

    DIR:    { { ->WK ->BIN ->PLT ->PHN ->FIN ->STAT}
              { HOME ->PG1 ->PG2 ->PG3 ->PG4 ->PG5 } }

     CD:    << PCD SPCD MV >>

     MV:    << 1 DO GETI EVAL UNTIL 46 FS? END DROP2 >>

   SPCD:    << PATH DUP HOME 'PCD' STO MV >>

    PCD:    { variable path }

   OGET:    << -> v i << v "(" + i ->STR + ")" + S->N EVAL >> >>

    OFF:    << # 18E58h SYSEVAL >>

 SHFTON:    << # 1F8A7h SYSEVAL >>

SHFTOFF:    << # 1F8B4h SYSEVAL >>


->PG1 Directory:
================

   GETP:    << VARS 1 { } 'Tmp' STO
               DO GETI DUP IFERR RCL SWAP Tmp SWAP + 'Tmp' STO
               ROT ROT THEN DROP2 END UNTIL DUP 1 SAME END
               DROP2 Tmp 'Tmp' PURGE FLIPL >>
   PUTP:    << 1 DO GETI 4 ROLL SWAP STO UNTIL DUP 1 SAME END DROP2 >>

   RDIR:    << VARS LROL ORDER >>

   (See IN Description (helpful hint #2) before typing in)
     IN:    << CLLCD -> s p << "" s "" <> s ": " + s IFTE 's' STO
               WHILE IFERR DO s OVER + "_" + p IN2 s OVER + p IN2
               UNTIL 0 END THEN END DUP "ENTER" <> REPEAT DUP "INS"
               == << DROP LCD-> 'lcd' STO HALT "" lcd ->LCD 'lcd'
               PURGE >> IFT DUP "BACK" == << DROP 1 OVER SIZE 1 -
               SUB "" >> IFT + END DROP DUP s SWAP + p DISP >> CLMF >>

    IN2:    << DISP 1 40 START KEY 'IN2' IFT NEXT >>

   LROL:    << 1 GETI ROT ROT OVER SIZE SUB SWAP + >>

   LROR:    << DUP SIZE GETI ROT ROT OVER SIZE 1 - SUB + >>

  LDISP:    << -> s l << LCD-> "" 1 23 s SIZE - 2 / IP
                START " " + NEXT s + l DISP LCD-> OR ->LCD >> >>

    LDP:    << -> s l << LCD-> s l DISP LCD-> OR ->LCD >> >>

  CDISP:    << 1 3 FOR j " " j DISP NEXT 2 LDISP >>


->PG2 Directory:
================

  SOLVE:    << FAST SWAP -> x << 'Tpow' STO 'Teq' STO 1 Tpow
               START Teq DUP x 0 ROOT DUP 3 ROLLD NEG x + / x Tpow
               1 - DUP 'Tpow' STO TAYLR 'Teq' STO NEXT { Teq Tpow }
               x + PURGE >> >>

  PEEK2:    << 2 * R->B PEEK HP->S >>

  FIND2:    << ROT S->HP ROT ROT FIND >>

   PEEK:    "76C20 A63C0 69C20 88100 8F180 501BF 510CD 21441 B9F00 C1423
             4E000 08BE9 13410 200DA 8F8B0 508DA 69301 B6110 CAF01 5B915
             62A26 A265D 01B69 00C15 8E340 7A20D 51471 37143 8A461 13517
             41471 37143 8A0D0 34202 00679 F84A1 79143 1008F 8B050 14713
             71791 43C43 4A000 0C210 98F8B 05011 98FEA 35053 28F8B 05086
             A908D E3930 8F49A 4085A 65DF1 3610A 13434 E4A20 14434 50000
             16411 1EA14 0164D 81101 31E18 A943A E015B 03103 A6A31 939EA
             90317 0A6A1 48161 17034 20000 6ACF8 F8B05 0174E 71121 41142
             16480 8C09F 20"

   FIND:    << -> spat sadr eadr << FAST spat SIZE 4096 eadr sadr - B->R
               MIN MAX R->B -> const << { }
               DO sadr const PEEK
                  IF spat POS sadr OVER THEN + DUP 'sadr' STO 1 - +
                  ELSE + const + 'sadr' STO END
                UNTIL sadr eadr >= END >> >> >>

  S->HP:    << -> s << RCWS HEX 8 STWS "" 1 s SIZE FOR j s j j SUB NUM
               R->B RL RL RL RL ->STR 3 4 SUB + NEXT >> SWAP STWS >>

  HP->S:    << DUP SIZE -> s n << RCWS HEX 8 STWS "" 1 n FOR j "#" s j
               DUP 1 + SUB + "h" + STR-> RL RL RL RL B->R CHR + 2 STEP
               >> SWAP STWS >>

    RAM:    << # C0000h # D0000h >>        ; Range of Ram...

->PG3 Directory:
================

     DX:    << PATH DUP SIZE GET
               { FAST DX UP CLOCK MOVE SOLVE CHKSUM GETP PUTP
                 PEEK2 FIND2 LDISP DEL* DELX EXCO ERA PURG }
               + MENU >>

   MVUP:    << PATH DUP SIZE 1 GET EVAL >>

     UP:    << SPCD MVUP DX >>

   MOVE:    << FAST SPCD 'DIR(1)' EVAL MENU HOME HALT 'DIR(2)'
               EVAL SWAP + MV DX >>

   DOWN:    << VARS DUP SIZE -> v sz
               << IF sz 0 <> THEN
                  << { DX *** } 1 sz FOR j v j GET
                      IFERR RCL DROP THEN +
                      END
                   NEXT MENU >> EVAL
                  END >>
               >>

   YKEY:    << DO UNTIL KEY END "Y" SAME >>

    VER:    << CLLCD "    REALLY (Y/N) ?" 2 DISP 500 .1 BEEP
               IF YKEY NOT THEN "ABORTED" CDISP KILL ELSE CLMF END >>

    ERA:    << VER VARS LIST-> 1 SWAP START PURG NEXT >>

   PURG:    << 31 SF IFERR PURGE THEN DUP EVAL ERA MVUP PURGE END >>

   S->N:    << "'" SWAP + STR-> >>

   N->S:    << ->STR DUP SIZE 1 - 2 SWAP SUB >>

   EXCO:    << << EXPAN >> MULTI << COLCT >> MULTI >>

  MULTI:    << -> p << DO DUP p EVAL UNTIL DUP ROT SAME END >> >>

   DEL*:    << 'Z' (d/dx) ROT 'X' (d/dx) ROT 'Y' (d/dx) + + EXCO >>

   DELx:    << -> a b c
               << c 'Y' (d/dx) b 'Z' (d/dx) - EXCO
               a 'Z' (d/dx) c 'X' (d/dx) - EXCO
               b 'X' (d/dx) a 'Y' (d/dx) - EXCO >> >>


->PG4 Directory:
================

  CLOCK:    << RCWS 64 STWS LCD-> CLLCD WHILE KEY NOT REPEAT " " DATE
               FMTDATE + 2 DISP TIME SWAP DROP FMTTIME "      " SWAP
               + 4 DISP END DROP ->LCD STWS CLMF >>

SETTIME:    << 0 'CKOR' STO TIME SWAP DROP HMS-> SWAP HMS-> DUP2
               IF > THEN 24 + END SWAP - 'CKOR' STO >>

SETDATE:    << -> d << DM d CJ2 707788800 * - 'DKOR' STO >> >>

   TIME:    << TM DUP B->R 29491199 / 24 MOD CKOR + 24 MOD ->HMS >>

   DATE:    << DM DKOR - 707788800 / JC2 >>

     TM:    << RCWS 64 STWS # 4554d SYSEVAL SWAP STWS >>

FMTTIME:    << RCLF 58 CHR -> t f c << t 10000 * IP 10000 / 't' STO
               IF t 12 >= THEN t 12 - 't' STO " pm" ELSE " am" END
               IF t 1 < THEN t 12 + 't' STO END t IP STD ->STR c + t
               FP 4 FIX ->STR DUP 3 4 SUB c + SWAP 5 6 SUB + + SWAP
               + f STOF >> >>

FMTDATE:    << RCLF STD -> d f << d DOW2 SWAP DROP ", " + MTHS d IP
               GET + " " + d FP 100 * IP ->STR + ", " + d 100 * FP
               10000 * ->STR + f STOF >> >>

     JC:    << 1721119.2 - DUP DUP 36524.25 / IP SWAP OVER + SWAP 4
               / IP - DUP ROT DROP 365.25 SWAP OVER / IP SWAP OVER *
               SWAP ROT ROT IP - .3 - DUP 30.6 SWAP OVER / IP SWAP
               OVER * SWAP -> k << SWAP OVER - 1 + SWAP DROP k >>
               DUP 9 IF > THEN ROT 1 + SWAP 9 - ELSE ROT SWAP 3 + END
               ROT IP >>

     CJ:    << << 2.85 - 12 / + >> -> y m d yp << 367 y m yp EVAL *
               IP y m yp EVAL IP - .75 y m yp EVAL IP * - d + IP .75
               y m yp EVAL 100 / IP * - IP 1721115 + >> >>

    DOW:    << CJ 1 + 7 MOD DUP 1 + DAYS SWAP GET >>

    JC2:    << JC 100 / + SWAP 1000000 / + >>

    CJ2:    << DUP IP SWAP FP 100 * DUP IP SWAP FP 10000 * ROT ROT CJ >>

   DOWN:    << CJ2 1 + 7 MOD DUP 1 + DAYS SWAP GET >>

   DAYS:    { "Sun" "Mon" "Tues" "Weds" "Thur" "Fri" "Sat" }

  NDAYS:    { 31 28 31 30 31 30 31 31 30 31 30 31 }

   MTHS:    { "Jan " "Feb " "Mar " "Apr " "May " "June" "July" "Aug "
              "Sept" "Oct " "Nov " "Dec " }

    CAL:    << LCD-> SWAP DUP FP SWAP IP .01 + 100 * + 100 /
               -> date << "" 1 date DOW2 DROP DUP2 IF s THEN
               FOR x "   " + NEXT END DATELIST + -> l <<
               "      " -> s << s MTHS date IP GET + " " + date
               100 * FP 10000 * ->STR + s + "  S  M  T  W  T  F  S"
               + l + 'l' STO { } l 1 21 SUB + l 22 42 SUB + l 43 63
               SUB + l 64 84 SUB + l 85 105 SUB + l 106 126 SUB + l
               127 147 SUB + l 148 168 SUB + DUP SIZE
               -> list size << WHILE KEY NOT REPEAT 0 size 1 - FOR
               ofst 1 4 FOR d list ofst d + IF DUP size > THEN size -
               END GET d DISP NEXT .75 WAIT NEXT END >> >> >> >>
               ->LCD CLMF >>

 MTHLST:    << RCLF STD -> f << DUP IP SWAP FP 10000 * -> mm yy << yy
               mm 1 DOW DROP -> dow << "      " -> s << { } s MTHS
               mm GET + " " + yy ->STR + s + + "  S  M  T  W  T  F  S"
               + -> ml << "" IF dow 0 <> THEN IF 1 dow <= THEN 1 dow
               START "   " + NEXT END END 1 NDAYS mm GET IF mm 2 ==
               yy 4 MOD 0 == AND THEN 1 + END FOR x " " + IF x 10 <
               THEN " " + END x ->STR + NEXT DUP SIZE -> dl s
               << 0 s 21 / IP FOR x ml dl x 21 * 1 + DUP 20 + SUB +
               'ml' STO NEXT ml " " + >> >> >> >> >> f STOF >> >>

     DM:    << RCWS -> w << 64 STWS TIME HMS-> 12 SWAP - 29491200 * DUP
               IF 0 < THEN NEG - ELSE + END B->R w STWS >> >>

 TMSTMP:    << DATE FMTDATE PR1 TIME FMTTIME PR1 3 DROPN CR CR >>

   DCAL:    << LCD-> SWAP MTHLST DUP SIZE -> l s << WHILE KEY NOT
               REPEAT 0 s 1 - FOR k 1 4 FOR d l k d + IF DUP s >
               THEN s - END GET d DISP NEXT .5 WAIT NEXT END DROP
               ->LCD CLMF >> >>

   CKOR:    13.2727633333          ;  Varies when time is set.

   DKOR:    -1.46830298706E15


->PLT Directory:
================

   PLOT:    << PBEG PEND PSTEP -> b e s
                << ".. Working .." 2 LDISP
                  [ 0 ] '(SIGMA)DAT' STO '(SIGMA)DAT'
                  e b - s / 1 + IP 2 2 ->LIST RDM
                  '(SIGMA)DAT' { 1 1 } b e
                  FOR t t XEQ PUTI t YEQ PUTI s STEP
                  DROP2 CLLCD SCL(SIGMA) 4.28125 *W 200
                  .05 BEEP DRW(SIGMA) DGTIZ >>
             >>

    XEQ:    << -> X 'X+2' >>

    YEQ:    << -> Y 'Y-2' >>

   PBEG:    Beginning number
   PEND:    Ending number
  PSTEP:    Step size


->PHN Directory:
================

  PFIND:    << 1 'LNUM' STO PGET >>

  PNADD:    << FAST "Name" 2 IN "Number" 2 IN -> name num
               << NAMES name + 'NAMES' STO PNUMS num + 'PNUMS' STO >> >>

  PNEXT:    << IF LNUM 1 <> THEN LNAME PGET ELSE "NO ENTRIES" CDISP END >>

   PGET:    << "Name" 2 IN IFERR NAMES SWAP LSTR DUP NAMES SWAP GET SWAP
               PNUMS SWAP GET SWAP 1 DISP "" 3 DISP 2 DISP THEN DROP2
               "NOT FOUND" CDISP 55 .1 BEEP END >>

   LSTR:    << -> l s << s 'LNAME' STO l s POS DUP 0 <=
               IF THEN DROP 1 'y' STO LNUM l SIZE
                 FOR x l x GET s POS y AND
                   IF THEN x 0 'y' STO x 1 + 'LNUM' STO
                     IF LNUM l SIZE > THEN 1 'LNUM' STO END
                   END
                 NEXT
                 IF y THEN 0 1 'LNUM' STO END 'y' PURGE
               END >> >>


->STAT Directory:
=================


  SORTS:    << FAST CL(SIGMA) 1 + -> d << 1 d 2 - FOR i d i - -> j << 2 j
               START MXMN j ROLL NEXT SWAP >> MXMN (SIGMA)+ NEXT (SIGMA)+
               RCL(SIGMA) { N(SIGMA) } RDM STO(SIGMA) >> >>

  SORTA:    << FAST N(SIGMA) -> n << (SIGMA)DAT { n } RDM '(SIGMA)DAT'
               STO 1 n FOR i 1 n FOR j '(SIGMA)DAT' i GET '(SIGMA)DAT'
               j GET MXMN '(SIGMA)DAT' j ROT PUT '(SIGMA)DAT' i ROT PUT
               NEXT NEXT >> >>
   MXMN:    << DUP2 MAX 3 ROLLD MIN >>


Misc Routines:
==============

     UP:     << PATH DUP HOME SIZE 1 - 1 MAX 1 SWAP
                FOR x DUP x GET EVAL NEXT DROP DX >>

   MOVE:     << HOME ->PRG { DX *** ->PRG } GETDIR MENU >>

 GETDIR:     << VARS DUP SIZE -> v sz
                << IF sz 0 <> THEN
                   << 1 sz FOR j v j GET
                         IFERR RCL DROP THEN
                            DUP ROT ROT + SWAP EVAL GETDIR UP
                         END
                      NEXT >> EVAL
                  END >>
               >>

    TMX:    << HOME FLIPL LIST-> 1 SWAP START EVAL NEXT >>
               ; Given a path, move to the directory

  FLIPL:    << DUP SIZE -> a
               << 1 a
                 FOR j DUP 1 a +
                   j - GET SWAP
                 NEXT DROP a
                 ->LIST >>
             >>

  FLIPL:    << { } SWAP 1
 (CF02)        DO GETI 4 ROLL + ROT ROT UNTIL 46 FS? END DROP2 >>

     MX:    << HOME DUP 1 1 ROT SIZE START GETI EVAL NEXT DROP2 >>

   LROL:    << LIST-> -> n << n ROLL n ->LIST >> >>
  (511C)

   COMP:    << IFERR R->B THEN END 2 RCWS ^ OVER - DUP 1 - SWAP >>
  (805C)

  SPEED:    { # 895938158852439996d          ;Used by old ver. FAST below
  (8C57)      # 4047118155055345d            ;This must be the first
              # 3519005774319921d }          ;variable in HOME directory!

   FAST:    << 'SPEED' -> s n                ; Old version of FAST
  (6D14)       << SPCD HOME RCWS             ; Does not create a
                 64 STWS s R->B # 15d        ; System object
                 AND
                 # 281474976710656d *
                 # 891716034201780156d
                 OR {
                 # 4047118155055345d
                 # 3519005774319921d
                 } + n RCL SWAP n
                 PURGE n STO
                 # 917431d SYSEVAL n
                 STO STWS CD >>
              >>

============================ USEFUL SYSEVALS =============================
ALL Locations in HEX!!

Improper use of sysevals can result in MEMORY LOST or worst! so don't use
them unless you know what you are doing!

The "speed nibble" syseval (may/may not ??) be dangerous, the others are
safe.

    HP28C      HP28S    Function
 1BB    1CC     2BB
-------------------------------------------------------------------------
   A      A       A     Displays calculator version and copyright notice
              18E58     Suspends current operations, turns calculator off
 9C96  9C61   1F8A7     Turns SHIFT annunciator ON
 9CA3  9C6E   1F8B4     Turns SHIFT annunciator OFF
 123E  1266    11CA     Returns contents of built-in timer (see CLOCK prog.)
              DFFB7     Speed nibble (see non-sysob version of FAST)



I lost the sysevals for placing the calculator in edit mode and ins mode,
will someone please post.

============================= HELPFUL HINTS ==============================

1)
     When typing in programs with many local (lower case) variables or when
typing strings containing only hex digits (ie. see FIND and PEEK
respectively), it is helpful to create a menus containing the needed lower
case variable names (ie. { spat sadr eadr const } MENU ) or hex digits (ie.
{ A B C D E F } MENU ).  This helps to avoid the dreaded upper/lower case
program drudgery and having to hunt for hex digits.

2)
     When special characters are needed such as for the IN program, the
easiest way to obtain them is to create a variable with the special
character as the name.  Then pressing the variable name while writing the
program will insert the special character into the program.

Example, to create two variables whose names are ':' and '_' respectively.

      1)  58 CHR DUP "'" SWAP + STR-> STO      ; create ':' variable
      2)  95 CHR DUP "'" SWAP + STR-> STO      ; create "_" variable

If the CHR numbers are inconvenient to memorize or look up, a whole
directory of most often used special symbols can be used.

3)
     Storing subprograms into strings and then performing STR-> evaluates
the string program AND allows variables in the string to be interpreted as
currently defined local variables.

Example:  Program A :  << -> x << B STR-> >> >>
          Program B :  "x x +"

  ,will take a number off the stack and return the number added to itself.

4)
     Don't mess with sysevals unless you know what your doing or are willing
to accept a memory lost!


======== cut here ======== COMMENTS FOR THE NET ======== cut here ========

     I have noticed after looking through past months of archives that many
programs presented are in a form I personally find difficult to key in,
follow, etc.  Luckily this is not too often and most are good to excellent.
I suggest the following to someone considering posting to the net.

1)  ALWAYS provide checksums for ALL code regardless of the size!

2)  Tell what you are using for symbols, (Yes, I know I'm being picky)
    ie is NOT EQUAL defined as <>, !=, #, etc.

3)  If in doubt as to whether or not you should post a program, don't ask
    people if they want to see or are interested in it, just post it!  If
    someone doesn't want to read your program, fine, that's what n is for.
    I for one likes to see code, not necessarily for the program itself,
    but to see how something was done as opposed to how I might do the same
    thing.

4)  Format your program with purpose.  I chose to block my code so I could
    fit more programs on a page.  For programs under 4 lines long with
    checksums, I (personally) think this is fine whereas long programs may
    need better structure.  Use indentations gracefully, ie:

    DON'T:                           DO:
             .                               .
             :                               :
            FOR k 1 4                FOR k 1 4
              FOR d l k d              FOR d l k d +
    +                                    IF DUP s > THEN s - END
                IF DUP s >               GET d DISP
                THEN s -               NEXT .5 WAIT
                END GET d                    .
    DISP                                     :
              NEXT .5 WAIT
             .
             :

5)  Tell what the programs arguments and results are, example runs are
    good.

6)  Keep programs as modular as possible even if you can save 16 bytes by
    writing 1 huge program (28C owners neglect).  If it turns out that there
    are many modules, create a directory, that's what they're for.

7)  Keep all personal dialogue in one or two easy to delete places.  When I
    find a net posting worth keeping, I tend to extract, cut away the fat,
    and keep only the meat.  I suspect many others do also.

8)  Comment occasionally, but sparingly.
    (Yeah, I definitely fail this one, but see #9)

9)  If your life is a donut, forget the first 8 rules and gives us whatever
    you can.

        Suggestions, comments, and derogatory remarks welcomed!


========================= QUESTIONS FOR THE NET ==========================


1)  Does the depth of directory structure greatly affect performance
    (ie. the recall of variables/programs from higher directories, not
    delay due to user programs climbing up and down!) if so, how much?

2)  Will somebody please post one definitive article that lists all the
    collective net knowledge on sysevals addresses and there functions?

3)  Does people have any particular helpful hints to share?

4)  Is there any tricky way (ie. POKING) to rename a directory without
    creating a new directory, copying vars/progs, deleting old directory?

5)  Aren't there any EE's out there, I want a good program to do FFT's.
    I keep talking myself out of writing one because I'm sure somebody
    in net land has surely written one already and will post any day
    now (hint, hint).


CREDITS:  (So as to not step on anyone's toes)

    The above represents a great deal of effort on my part in terms of code
writing, modification of others code, and shear ripoff of some code in it's
entirety!  I don't claim to have written all code presented but I have
written or modified most of it.  I did not list individual contributions
because I don't know the original authors of some of the code.  I will
ATTEMPT to list some of the known authors of some of the above code.

     Jean-Charles Andlauer             ( Alphabetical order! )
     Aaron Dinwiddie
     Strauss Erez
     Ulli Horlacher
     Stefan Kaufmann
     Stephen Lusi
     Bob Peraino of George Mason University
     Randall C. Wood

     If there are name misspelling, sorry.  If someone feels slighted and
wants there name on the list, let me know and I'll tack you on the next go
around.


PS:
     Your evaluation, did I skim over things too much, not enough???
I intend to continue to expand this file and repost occasionally as
improvements, suggestions, corrections, and new things are added.


                                              Aaron Dinwiddie
                                                -> Agima <-
------------------------------------------------------------------------------

Thanks for the posting, as a hp28 user of less than a week when I received
your posting it certainly helped me get of the ground in the right way.
Lots of nice utilities to start me off, and some good suggestions about
my user directory structure. I have adopted a structure that is a hybrid
of yours and one suggested in 'Insights':
                          HOME
                           |
                          ->U1
                           |
                          etc 
                           |
                          ->U5
                           |
                          MAIN
               -----------------------------
              UPRSNL    UEE     UGAMES   UETC
                |        |        |        |
              APRSNL    AEE     AGAMES   AETC
 
The idea is to store general utilities of increasing complexity in HOME to MAIN
(i.e. low level stuff in HOME, and things like the real time clock in U5.
UEE is for Electrical Eng specific utilities and AEE for the actual applic'ns.  
HOME directory contains several simple programs to jump me down to the
applications areas at one key stroke. I have also created various programes
for things like HOME UP PATH etc, each with one letter names for quick typing.

Comments on this would be greatly appreciated before memory is so full that
moving it all about would be a pain.

I especially liked the CLOCK utility you included. Could you confirm the
following typo's, or correct me?

DOWN should be DOW2, the checksum doesn't add up either
What is CAL for ?
The routine CAL* mentioned in the desciption is really called DCAL
I get the checksum for DOW to be 588C.
You mention DW, with checksum 7A7E, its not included in your posting,
   It all works without it anyway :-)


Finally:
   How about some application software. I am sure I am not the only one
out here looking for ideas. I would appreciate anything on the following:

Electronic Eng utilities / applications
Amateur Radio ( any Satelite stuff)
Games
Simple appointment diary to go with the CLOCK utility

I have written some amateur radio utilities, and will post in the next
day or so, cant promise it any sooner as I'm still 24hours a day hooked
on the 28S, so have no time for notes!

Many Thanks
James Gentles (P.S. 4 copies of basenote received a-o-k in Scotland:-)

---------------------------------------------------------------------
      I have no professional connection with Hewlett-Packard's 
    calculator operations other than as a user of their products.
---------------------------------------------------------------------
Opinions expressed are my own, and are not intended to be an official
              statement by Hewlett-Packard Company
---------------------------------------------------------------------
Name:         James Gentles   GM4WZP
Organization: Hewlett-Packard  Queensferry Telecomunications Division
Email:        jdg@hpqtdla                   
Address:      Station Road, South Queensferry, West Lothian, Scotland
---------------------------------------------------------------------
