Post Reply 
CC41 RPN Calculator
01-21-2023, 06:26 PM
Post: #1
CC41 RPN Calculator
I've been working on CC41 for some time, it is an update of NQ41 bringing full programmability and most recently supporting decimal math to 16 places.

CC41 can be downloaded for Mac, Windows and Linux from GitHub.

CC41 is a re-creation of many of the functions of Hewlett Packard's HP-41CX calculator in software. Most calculator programs recreate a graphical interface resembling a calculator requiring the user to either use a mouse to enter commands and numbers or use a somewhat non-intuitive keyboard mapping where one key on the PC's keyboard maps to a key on the graphical calculator. With CC41 you can quickly type a function such as "1/x" rather than having to memorize which keyboard key the function is mapped to. CC41 contains 1000 data memory registers (0-999) and 65535 program memory registers as well as 64 flags, numbered 0 to 63. Using PATH to navigate your computer’s filesystem CC41 can read programs using GETP and GETSUB and remove them with PCLPS. CC41 can automatically load a program on launch and optionally begin running it.

Try CC41!
Find all posts by this user
Quote this message in a reply
01-22-2023, 02:29 AM
Post: #2
RE: CC41 RPN Calculator
The macOS version of CC41 is not executable in its currently uploaded form. It's just a binary file.
Find all posts by this user
Quote this message in a reply
01-22-2023, 03:10 AM
Post: #3
RE: CC41 RPN Calculator
No error. It is not anything the Mac recognizes as a launchable app.

Its file type is a generic document, which can be opened with BBEdit or your favorite text editor. Terminal does not recognize it as a command, so there is a step missing before it can be launched or executed.

Tested on macOS 11.7.2 (Intel) and 13.1 (M1).
Find all posts by this user
Quote this message in a reply
01-22-2023, 03:22 AM
Post: #4
RE: CC41 RPN Calculator
(01-22-2023 03:10 AM)John Galt Wrote:  No error. It is not anything the Mac recognizes as a launchable app.

Its file type is a generic document, which can be opened with BBEdit or your favorite text editor. Terminal does not recognize it as a command, so there is a step missing before it can be launched or executed.

Tested on macOS 11.7.2 (Intel) and 13.1 (M1).

Thanks for posting, both of the following methods work, while downloading straight from the macos_12 folder on GitHub corrupts the file for some unknown reason.

1. On the right side of the main page is a "releases" button which gives you the choice of a zip file or tar.gz file, both of those work.
2. Cloning the repository and launching from the macos_12 folder works also.

Try CC41!
Find all posts by this user
Quote this message in a reply
01-22-2023, 03:36 AM
Post: #5
RE: CC41 RPN Calculator
(01-22-2023 03:22 AM)Craig Bladow Wrote:  ... while downloading straight from the macos_12 folder on GitHub corrupts the file for some unknown reason.

Aha. Yes, that's what happens. Downloading the .zip file worked perfectly, and expands to properly executable files.

Thanks!
Find all posts by this user
Quote this message in a reply
01-22-2023, 03:56 AM
Post: #6
RE: CC41 RPN Calculator
(01-22-2023 03:36 AM)John Galt Wrote:  
(01-22-2023 03:22 AM)Craig Bladow Wrote:  ... while downloading straight from the macos_12 folder on GitHub corrupts the file for some unknown reason.

Aha. Yes, that's what happens. Downloading the .zip file worked perfectly, and expands to properly executable files.

Thanks!

Thanks for letting me know, I've removed the executables from the document tree so other people don't run into the same issue.

Try CC41!
Find all posts by this user
Quote this message in a reply
01-23-2023, 01:12 AM
Post: #7
RE: CC41 RPN Calculator
v0.42.01_alpha_decimal can now be downloaded from the link in the first post.

The following features or bug fixes were implemented in this release:
* CLD implemented for compatibility with programs that use it. It does not clear any previous or current output.
* Flag 22 now is set when user enters a number.
* X#Y added as an alias for x<>y?.
* TIME modified to return time to the thousandths of a second.
* TIME returning incorrect values fixed in Windows.

Blackjack from the 41C Standard Applications Manual runs!

Try CC41!
Find all posts by this user
Quote this message in a reply
01-23-2023, 12:57 PM
Post: #8
Suggestion
I have a suggestion about implementing local variables.

1) Issuing an XEQ "label" command makes a dynamic copy of the main memory that is availale to the code after "label". You can pass information to that subroutine using the stack AND memory registers.

2) Issuing GSB "label" does not copy the main memory!

3) When the XEQ "label" is done, the dynamic copy of the main memory is removed.

4) When using XEQ "label" the code can write to the main memory by using a special set of STO an RCL command like STO$ and RCL$. These commnds allow the executed subroutine to write results in the main set of memory registers.

Hope this helps!

Namir
Find all posts by this user
Quote this message in a reply
01-24-2023, 01:08 AM
Post: #9
RE: CC41 RPN Calculator
Namir,

I've had thoughts along these lines and I've made a note to entertain this feature or a similar one for a future release.

What you are asking for can be accomplished, albeit not so elegantly, using the existing commands that read and write data registers and calculator status which includes the stack. I use these when testing CC41, running a testing program that calls 14 different programs that each start with a fresh calculator state while returning a result back to the main program.

Try CC41!
Find all posts by this user
Quote this message in a reply
01-24-2023, 12:01 PM (This post was last modified: 01-24-2023 12:01 PM by Namir.)
Post: #10
RE: CC41 RPN Calculator
In my idea, the stack needs no be duplicated. Also if creating/removing a block of 1000 registers in dynamic memory is expensive, you can create a block of fewer memory registers, like 100 which is still plenty.

Namir
Find all posts by this user
Quote this message in a reply
01-25-2023, 02:41 AM
Post: #11
RE: CC41 RPN Calculator
(01-24-2023 12:01 PM)Namir Wrote:  In my idea, the stack needs no be duplicated. Also if creating/removing a block of 1000 registers in dynamic memory is expensive, you can create a block of fewer memory registers, like 100 which is still plenty.

Namir

Dynamically allocating 1000 64 bit registers (8000 bytes) on today's computers should be transparent to the user.

Try CC41!
Find all posts by this user
Quote this message in a reply
01-31-2023, 01:04 AM
Post: #12
RE: CC41 RPN Calculator
v0.42.02_alpha_decimal can now be downloaded from the link in the first post.

The following features or bug fixes were implemented in this release:
* USER command toggles flag 27 which enables User mode and prints User Mode On/Off.
* Setting and clearing flag 27 enables User mode without displaying a message.
* User mode enables executing global labels by entering the label's name without requiring XEQ.
* CAT 6 lists the Global labels if User mode is enabled.
* Added listing of decNumber math library version in ABOUT command.
* Modified Blackjack game and Financial calculations programs from HP-41C Standard Applications Handbook added in 41_programs folder.

Try CC41!
Find all posts by this user
Quote this message in a reply
02-04-2023, 08:35 PM
Post: #13
RE: CC41 RPN Calculator
v0.42.02_alpha can now be downloaded from the link in the first post.

No new features were added, two bugs were fixed.
Fixed "pi sf 60" displaying an incorrect 16th digit x: 3.141592653589793c
Fixed where "90 tan" would crash on MacOS only.

Try CC41!
Find all posts by this user
Quote this message in a reply
05-06-2023, 04:42 PM
Post: #14
RE: CC41 RPN Calculator
v0.42.04_alpha can now be downloaded from the GitHub link in the first post.

Changes include:
Added WATCH, UNWATCH and CLWATCH commands that help program development and debugging by displaying register contents.
Fixed string not recognized when when a space character immediately followed a double quote.
Fixed LIST only displaying the first 4 characters of an alpha string in Windows only.
Updated Control Flags section in user manual to show user mode flag 27 as not reserved.
Added alias so '!=' is recognized as meaning not equals in addition to '<>'.

Try CC41!
Find all posts by this user
Quote this message in a reply
05-07-2023, 03:51 AM
Post: #15
RE: CC41 RPN Calculator
Hi Craig,

I downloaded cc41 and it works fine on my linux box, one question though.
I noticed that memory is not preserved between runs. Is this intentional or do i need to do something special to enable memory preservation?

Thank you very much
Find all posts by this user
Quote this message in a reply
05-07-2023, 02:15 PM (This post was last modified: 05-07-2023 02:21 PM by Craig Bladow.)
Post: #16
RE: CC41 RPN Calculator
(05-07-2023 03:51 AM)nickapos Wrote:  Hi Craig,

I downloaded cc41 and it works fine on my linux box, one question though.
I noticed that memory is not preserved between runs. Is this intentional or do i need to do something special to enable memory preservation?

Thank you very much

The entire state and memory of the calculator can be saved to a file using WRTA and then restored when starting the program placing -r or -R [filename] on the command line invoking CC41. Also the READA command will do the same once the calculator is running.

As I have had that question before, I'll plan to add a flag that when set enables automatic continuous memory. Thanks for trying out CC41.

Cheers,
Craig

Try CC41!
Find all posts by this user
Quote this message in a reply
05-07-2023, 08:55 PM
Post: #17
RE: CC41 RPN Calculator
(05-07-2023 02:15 PM)Craig Bladow Wrote:  The entire state and memory of the calculator can be saved to a file using WRTA and then restored when starting the program placing -r or -R [filename] on the command line invoking CC41. Also the READA command will do the same once the calculator is running.

As I have had that question before, I'll plan to add a flag that when set enables automatic continuous memory. Thanks for trying out CC41.

Cheers,
Craig

Thank you very much for the clarification, and the flag addition
Find all posts by this user
Quote this message in a reply
06-05-2023, 10:20 PM
Post: #18
RE: CC41 RPN Calculator
v0.42.05 alpha can now be downloaded from the GitHub link in the first post.

Changes include:

Added flag 59 that when cleared enables continuous memory functionality. See the User Manual for more information.
Recognize ';' as beginning a comment
Fixed incorrect behavior when loading a program where an alpha string in the program had space character(s) after the first double quote.
Added check of path and warn if path doesn't have a trailing slash when using PATH or PATH+.
Fixed PATH+ to not append the Alpha register to the path if the register is empty.
Fixed extra characters printed when Alpha register content was exactly 24 characters long.
Automatically corrects use of incorrect slash in a path for the operating system in use.

Try CC41!
Find all posts by this user
Quote this message in a reply
06-22-2023, 03:42 PM (This post was last modified: 09-23-2023 04:18 PM by Craig Bladow.)
Post: #19
RE: CC41 RPN Calculator
v0.45.00 alpha can now be downloaded from the GitHub link in the first post.

Changes include:
New command SAVEP which saves a program in memory to a text file in a format accceptable to utilities that convert text file programs into HP 41 RAW file format.
Some CC41 command names have been changed for compatibility with the converter utilities. The previous commands will also continue to be accepted.
When the program is listed or saved using SAVEP, the new commands will be used.
This name change mainly affected the statistics functions where 'sum' was replaced by 's' for those functions.
CC41 also now accepts '>' as the append text character, along with '+' and '|-' (but not inside double quotes).
SAVEP and LIST will output '>' preceding text that is to be appended to the alpha register.

New command EXEQ that can execute a system command, shell script or batch file. This can be used to call an external utility to convert the output of SAVEP so it can be loaded into a 41 compatible calculator or emulator. In the case of a USB connected, file system enabled, DM41X, the raw file can be copied directly to the calculator. Also EXEQ could be used to call another instance of CC41, sending data and state using existing commands and also reading the results. (See Namir's earlier request)
Tested with: https://dm41.swissmicros.com/ (Must manually change SAVEP append symbol '>' to '|-')
Tested with comp41 from lifutils https://github.com/bug400/lifutils
Tested with 41uc from https://sourceforge.net/projects/hp41uc/

Try CC41!
Find all posts by this user
Quote this message in a reply
10-21-2023, 10:41 PM
Post: #20
RE: CC41 RPN Calculator
I'm replying to Allen's post in the HHC 2023 RPN Programming Contest thread and quoting the post as it appears in that thread.

Allen, thanks for using CC41 and sending feedback! It really helps me to find issues when other people use it.

(10-21-2023 07:26 PM)Allen Wrote:  Craig,
Thank you for the interesting CC41 program and congrats on the solution at the conference! I really love the "load and run this program on start"!! On the face that seems really handy, and I was preparing to do on the computer what I've been doing by hand the last week or so, until...

There are a few small behaviors that are somewhat different than a normal 41C would do:

Code:
> pi     x: 3.1416 y:50.0000 z:0.0000 t:32.0000 l:50.0000 a:
> cos     x: 0.9985 y:50.0000 z:0.0000 t:32.0000 l:3.1416 a:
> isg x   x: 49.9985 y:50.0000 z:0.0000 t:32.0000 l:3.1416 a:
> dec   x: 40.0000 y:50.0000 z:0.0000 t:32.0000 l:49.9985 a:

(this is correct for input of 50.0000, but 49.9985 should say "DATA ERROR" and leave x value unchanged?)

or
Code:
> pi     x: 3.1416 y:0.0000 z:41.0000 t:50.0000 l:49.0000 a:
> cos     x: 0.9985 y:0.0000 z:41.0000 t:50.0000 l:3.1416 a:
> isg x     x: 49.9985 y:0.0000 z:41.0000 t:50.0000 l:3.1416 a:
> int     x: 49.0000 y:0.0000 z:41.0000 t:50.0000 l:49.9985 a:
> dec     x: 0.0000 y:0.0000 z:41.0000 t:50.0000 l:49.0000 a:

(0.00 is not a valid oct to dec conversion for anything except input of 0.000 . should say "DATA ERROR" and leave x value unchanged?)

Neither of these x values would be allowed without error checking the OCT->DEC command for integer input not containing the '9' digit in the base10 number. the DEC->OCT command does not have the numerical restriction, but should check for integer input.
Code:
> 5.5     x: 5.5000 y:0.0000 z:0.0000 t:41.0000 l:49.0000 a:
> oct     x: 6.0000 y:0.0000 z:0.0000 t:41.0000 l:5.5000 a:

should also return error and leave x value unchanged?

I confess I've only looked at it for a few minutes, so if this is something clearly addressed in the nicely written manual (which I did search for notes on OCT and DEC behaviors) , it is my own lack of reading and I apologize in advance.

Allen, thanks for pointing out these differences in OCT and DEC behavior, I've added addressing these issues to my to do list for CC41.

Cheers,
Craig

Try CC41!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)