[comp.sys.handhelds] HP 41CV Emulator Application Card -- Review

smithj@jacobs.CS.ORST.EDU (Jeremy Smith) (11/04/90)

arnaud@schizo.imposter.samsung.com (Alain Arnaud) asks:

                   What's the 41CV emulator?
____________________________________________________________________________
     The HP-41cv emulator is a card that plugs into the back of the 48 like
other cards, and its function is to emulate the HP-41cv calculator on the
48.  The HP-41cv calculator was originally introduced in 1979 (actually the
`C', the `CV' came out a couple of years later, with additional functions). 
I reckon the emulator will let you run 41 programs on your 48.  They can be
uploaded directly from the 41 via the blinky (HP-41 IR module) to the IR
port in the 48.  I reckon you can also edit 41 code (FOCAL) in its native
state when the 41 emulator is invoked on the 48.

     The 41 emulator was officially mentioned (here) in late May, but I
don't think officially introduced yet.  I know it is not quite finished, but
would imagine it would be officially introduced soon, and available by
christmas.

     I have owned a 41 since 1980 and used it extensively.  I have no plans
to get a 41 emulator since the 48 already does everything the 41 did and
much more.  In any case, both my ports are already full - the equation ROM
and the 128k ROM.  The 41 emulator will be most useful for folks (companies)
with a large installed base of 41 software that they now want to run
(faster) on a 48, with much more memory.

     Best wishes, Jeremy |-) 10:33pm PDT 9/10/90
____________________________________________________________________________
     Just days after the above response I got to play with a (pre-
production) HP-41 Emulator ROM (code named Hoover - it sucks 41 code).  It
was released officially on October 1, 1990, and should be available in the
stores within weeks.

     Having now played with it for a few weeks here are some comments in no
particular order:

     You enter the emulator by pressing LIBRARY, HP-41, and then the
HP41MODE key (you only see HP41 in the menu key).  It sets up the following
variables: PRG41 (empty directory where 41 programs will reside), HP41XROM
(empty directory where 41 XROM objects will reside), HP41KEYS, HP41REGS,
HP41STACK, and HP41PAR.  These are all put in the current directory.  You
could have many directories with a full independent emulated 41 environment
in each.

     You exit the emulator by pressing EXIT (or from some deep nested menu
by pressing Orange-Shift Blue-Shift, and then EXIT).

     The display is cute.  The X register is in the large size font.  Above
it in a smaller font are Y, Z and T, and below it in a still smaller font is
L (Last X).  It seems odd at first because you might be following a number
and it suddenly changes size (like Y rolling down into X), but it works very
well.

     You CAN edit 41 programs on the 48 - but by generating a string and
using the 48 editor.  (The diagram below depicts some functions and their
workings.  Following the diagram are some example programs transferred to
the 48 from both a 41 and a 42.)  However, when SSTing a 41 program each
instruction is correctly previewed.

     You can download 41 programs directly to the 48 by using the 41
infrared module (Blinky).  Simply PRP program_name and press CPTR (capture)
on the 48.  (INPTR is also built into the emulator, and can also be used.) 
The result is a variable (type: Library Data) in the 48, with a string in
level 1, usually the name of the program (see the examples given below). 
Pressing the variable soft key puts the Library Data in level 1.  Executing
->TXT( ) on the 48 converts the Library Data to a string.  The string can be
edited on the 48 just like any string; this one looks like 41 user code. 
The reverse instruction ->41( ) converts the string to Library Data (in
level 2) and variable_name (in level 1).  Pressing STO puts the Library Data
where the 41 emulator will treat it as a 41 program.

     You can't directly get 41 programs from the 48 to the 41.  The closest
you could get would be to generate a FOCAL string as described above,
transfer it to your flavour of PC and from there transfer it to your 41. 
This latter process I've never actually done, but from an IBClone I would
imagine using Southern Software's Link program or Tacit's PC 41 emulator
program.  In either case neither would be worth it unless you're a hardcore
HP handheld fanatic (in which case you already have the programs) or you're
a commercial enterprise.


[HP-41]     | PRP"name"--+
============|============|==================================================
            |            |                          
[IR link]   |            |                          
            |            |                          
============|============|==================================================
[HP48]      | CPTR       | INPRT                    
            |            v                          
            |        string                         
            |          ^ |                                2: number 
            |  ->TXT() | | ->41()     |^ HP41MODE     .-  1: "X"    |^ STO41
____________|__________|_|____________||______________|_____________||______
[HP-41      v          | |       EXIT ||              |             ||
Emulator]  PRGM--------+ |            v|        48TOX `-> X: number v| XTO48
               <---------+

->TXT()
          Library Data --> "string"

     Library Data is generated by pressing a 41 program `name' in the VAR
     menu.

->41()
          "string" --> Library Data `name'

     Pressing STO on the two results puts the library data back into `name'
     where the emulator can run it as a 41 program.

     You can extend the functionality of the emulator.  As an example here
is a 48 program that appears to the emulator as a valid 41 XROM:

          <<             Open program
          XROM "2613"    XROM keyword and ID
          "X" RCL41      RCL 41 "X" register to 48 level 1
          DUP            DUP in level 2
          "L" STO41      STO value into 41's LastX
          ACOSH          evaluate ACOSH of value in level 1
          "X" STO41      STO result into 41's X register
          >>             end program

     XROM is a 48 reserved word supplied on the emulator plug in card,
explicitly designed to allow users to write their own functions that emulate
real 41 XROMs (functions from plug in ROMs or modules).  In the above
example the 48 has an ACOSH function and thus the required acosh
functionality is easily supplied.  However, the functionality could be as
simple or as complex as the 48 allows (time and date functions, complex
computations, graphic programs).  In this way any conceivable functionality
could be added to the emulator as an XROM.

     You can transfer programs from the HP-42 (and any 41 compatible device
with IR capability) but the result requires additional editing.

     Here are some examples of programs transferred from a 41 (regular and
synthetic) and a 42, and the resultant strings on the 48:

                                            Regular HP-42
    Regular HP-41   Synthetic HP-41         program:
    program:        program:
                                            00 { 17-Byte Prgm }
    01 LBL 'TEST'   01 LBL 'Test'           01 LBL 'Test'
    02 RCL Z        02 RCL M                02 RCL 'Fast'
    03 STO 01       03 STO c                03 STO IND ST Y
    04 BEEP         04 TONE 89              04 BEEP
    05 END          05 END                  05 END

    | puts "TEST"   | puts "Test"           | puts "Test"
    | in level 1    | in level 1            | in level 1.
    V               V                       V

    "01 LBL 'TEST'  "01 LBL 'Test'          "01 XEQ 'S|'
    02 RCL Z        02 !Bad Reg Op Arg!     02 PRP
    03 STO 01       03 XEQ '['              03 'Test'
    04 BEEP         04 !Bad Reg Op Arg!     04 XEQ 'S|'
    "               05 XEQ 'c'              05 0
                    06 TONE 9               06 XEQ '{'
                    "                       07 XEQ '17-Byte'
                                            08 XEQ 'Prgm'
                                            09 XEQ '}'
                    [Note: synthetic        10 1
                    register 'M' prints     11 LBL 'Test'
                    as '[' on all           12 2
                    printers, and all       13 !Bad Reg Op Arg!
                    tones only printed      14 'Fast'
                    one digit.  The         15 3
                    above tone 89           16 !Bad Reg Op Arg!
                    translated and          17 XEQ 'IND'
                    executes as TONE 9.     18 XEQ 'ST'
                    This shows that the     19 XEQ 'Y'
                    parser (->41()          20 4
                    program) compiles       21 BEEP
                    the ASCII string as     22 5
                    received.]              "


     Wlodek has written a very comprehensive manual.  In addition to the
five chapters:

 (# pages)   Chapter     Title
      (13)        1.     Getting Started
      (37)        2.     The HP-41 Environment
      (25)        3.     Capturing HP-41 Programs and Data
      (24)        4.     Modifying HP-41 Programs
      (40)        5.     Extending the Environment
      ---
     (139)

      he has added five appendices:

      ( 7)        A.     Support and Service
      ( 6)        B.     Bibliography
      (11)        C.     Tables of Flags and XROM Identifiers
      (15)        D.     Advanced Applications
      ( 7)        E.     Error Messages
       --
      (46)

with appendix D containing technical details unusual for a product of this
kind, and most welcome if you knew the 41 well and wanted the `inside scoop'
on various and numerous details.  Wlodek, with his close association with
all 41 products (HP supported and otherwise) has great insight into many of
the more esoteric problems some users may encounter.

     It is surprisingly fun to play with.  It goes a lot further than you
expect.  Users of 41s will find that just about anything they can do on
their 41s they can do on their 48 with the emulator; the programmers did a
very thorough job.  I reckon that anyone who needed to use it, say for a
job, would not find it a struggle, and would enjoy the work.  This speaks as
much for the 48 as well as for the unlimitedness of the emulator.

     There are many details not covered; the above are just some things I
did play with.  One function I found intriguing:  VERS41.  It puts the
following string on the stack:

"0A
Copyright 1990
Zengrange Inc
900928 0133
Design & code:
FCW,IM,RWJ,DRC
Manual:WACM-J,MHJ,TJW
for Terra Pacific
Help: TWB,CB,SB,DKB,
JAD,DLE,SRL,VKL,RM,
RJN,CP,GP,GS,JS,BGS,
BAS,ELV,WCW,RSW,DY,RY
Patience:SHC,HG,PK"

Jeremy |-) Smith    4:30pm PDT October 9, 1990

Note:     This review is based on a pre-production version.  Now that I've
          had a chance to look at the actual product the only main
          difference is that appendices B, C, and D of the manual have been
          reduced about 50%.                                        10/31/90
                                __________
                               /\  _______\
GEnie:   Jeremy.Smith          \ \ \____  / CompuSuk: 76662,1535
Bitnet:  Jeremy@OrState         \ \ \/ / /      JJSmith@OrState