Post Reply 
newRPL - build 1255 released! [updated to 1261]
06-11-2019, 11:00 PM (This post was last modified: 06-11-2019 11:23 PM by wyatt8740.)
Post: #501
RE: newRPL - build 1255 released! [official and unofficial]
Is there some way I could use newRPL as a sort-of-replacement for 'dc' as a text-based calculator in a terminal?

i.e., a way that I can pipe RPL as text to standard input, and have the software print the results?

example of my current usage of dc on my freeBSD and Debian Linux systems, but using the (non-standard!) ';' character as a 'comment marker' for explanation:
Code:
$ dc
10 k            ; Pop 10 off the stack and set uses it to set the number of digits of fraction precision to 10 (dc defaults to integer math only)
1600 1200 /      ; divide 1600 by 1200
p               ; print the number on top of the stack
1.3333333333
q               ; quit (only necessary when not in a pipe; quits automatically on EOF or EOT [^D])
$
or, in a pipe:
Code:
$ echo '10 k 1600 1200 / p' | dc
1.3333333333
$

I'd love to have software with more features, such as modulus, functions, etc. - even a limited form without true programmability would be a welcome improvement for my shell scripts.

Additionally, I'd also like a way to use the simulator without showing the on-screen keyboard, which takes up a ton of screen space and isn't always necessary for simple tasks.

Wyatt Ward
Computer history enthusiast
Find all posts by this user
Quote this message in a reply
06-13-2019, 04:10 AM
Post: #502
RE: newRPL - build 1255 released! [official and unofficial]
(06-11-2019 11:00 PM)wyatt8740 Wrote:  Is there some way I could use newRPL as a sort-of-replacement for 'dc' as a text-based calculator in a terminal?

Yes, as a matter of fact, that's exactly what the simulator was before we introduced the GUI. Right now some libraries depend on the GUI, but you don't need to display it, just provide memory for it.


(06-11-2019 11:00 PM)wyatt8740 Wrote:  i.e., a way that I can pipe RPL as text to standard input, and have the software print the results?

That's quite easy to get working. The standalone compiler newrpl-comp does something similar: reads a text file, you could easily read a line from stdin instead, then it compiles it (one single call to rplCompile() achieves that), and then dumps the object to another file. You could very well EVAL the object and then decompile to text the resulting stack objects, then output them to stdout.

(06-11-2019 11:00 PM)wyatt8740 Wrote:  Additionally, I'd also like a way to use the simulator without showing the on-screen keyboard, which takes up a ton of screen space and isn't always necessary for simple tasks.
Never thought of that, it's easy enough to add so sure, why not.
Find all posts by this user
Quote this message in a reply
06-15-2019, 08:48 PM
Post: #503
RE: newRPL - build 1255 released! [official and unofficial]
Thank you Claudio L. that compiled fine.
Where I can get the actualized newrpl manual ?
Find all posts by this user
Quote this message in a reply
06-18-2019, 08:09 PM
Post: #504
RE: newRPL - build 1255 released! [official and unofficial]
(06-15-2019 08:48 PM)pidhash Wrote:  Thank you Claudio L. that compiled fine.
Where I can get the actualized newrpl manual ?

The official newRPL wiki has the most up-to-date documentation. It isn't anywhere near to being a proper manual, but I hope it suffices for the time being...
Find all posts by this user
Quote this message in a reply
06-18-2019, 08:58 PM
Post: #505
RE: newRPL - build 1255 released! [official and unofficial]
(06-07-2019 08:26 PM)Bernd Grubert Wrote:  
(06-07-2019 02:03 AM)Claudio L. Wrote:  Please do this and share here.

Here is the list, generated with a 39GS.

Regards
Bernd

Once again, thanks for your contribution. For completeness, I have attached the binary file with the 39gs bootloader. I extracted the bootloader from the list you kindly provided with the following program (for the curious only):
Code:

«
  16384 MKBINDATA
  #0h #FFFh FOR 'K' K data K 1 + GET 1 BINPUTW 
  NEXT
»

This program needs the list in 'data', and leaves a binary data object on the stack. From the simulator, I saved this object to a file, then edited the file (using Bless hex editor) to remove the first 8 bytes (file marker "NRPL" and 4-byte object prolog). I also replaced the serial number with CNAxxxxxxx, each user should edit the file and put his own serial there.

PS: The forum won't let me attach a binary file so I renamed it as .txt, but it's actually binary data ready to be flashed.


Attached File(s)
.txt  BOOTLOADER_39gs.txt (Size: 16 KB / Downloads: 2)
Find all posts by this user
Quote this message in a reply
06-19-2019, 10:44 PM
Post: #506
RE: newRPL - build 1255 released! [official and unofficial]
(06-06-2019 02:51 PM)Nigel (UK) Wrote:  
(06-06-2019 12:07 PM)Martin Hepperle Wrote:  Yes, maybe this is a better solution than to fiddle with a overlay and stickers etc.
Martin
Note that (much earlier in the newRPL development process) I found that the 49g+ drew a large current (several tens of mA) even when the calculator was turned off. I haven't checked this recently so I'm not sure if the problem was ever solved but it is something to bear in mind.

Is anyone currently using a 49g+ flashed with newRPL without the battery drain problem?

Nigel (UK)

Here I am: I own an old HP49G+, broken hinges and all Wink (S/N: CN33900342 on the backplate, S/N CN33928709 on the bootloader screen FWIW, which is version 3.15.04) and a newer HP50G (S/N: CNA6080048, bootloader v4.01.03.03)

I can confirm that the battery drain problem is still present with latest build: I bought fresh batteries and flashed build 1255. In a few seconds after startup the battery indicator lit up and the batteries were drained in a couple of days, even if the calc was switched off.

After having replaced the batteries I reflashed original ROM 2.15 and the new ones have lasted since. HP50G experiences none of these problems.

If there's something I can test on the hardware let me know but keep in mind I can barely use a multimeter so give me very detailed instructions!
Find all posts by this user
Quote this message in a reply
06-20-2019, 09:17 AM
Post: #507
RE: newRPL - build 1255 released! [official and unofficial]
(06-19-2019 10:44 PM)JoJo1973 Wrote:  
(06-06-2019 02:51 PM)Nigel (UK) Wrote:  Note that (much earlier in the newRPL development process) I found that the 49g+ drew a large current (several tens of mA) even when the calculator was turned off. I haven't checked this recently so I'm not sure if the problem was ever solved but it is something to bear in mind.

Is anyone currently using a 49g+ flashed with newRPL without the battery drain problem?

Nigel (UK)

Here I am: I own an old HP49G+, broken hinges and all Wink (S/N: CN33900342 on the backplate, S/N CN33928709 on the bootloader screen FWIW, which is version 3.15.04) and a newer HP50G (S/N: CNA6080048, bootloader v4.01.03.03)

I can confirm that the battery drain problem is still present with latest build: I bought fresh batteries and flashed build 1255. In a few seconds after startup the battery indicator lit up and the batteries were drained in a couple of days, even if the calc was switched off.

After having replaced the batteries I reflashed original ROM 2.15 and the new ones have lasted since. HP50G experiences none of these problems.

If there's something I can test on the hardware let me know but keep in mind I can barely use a multimeter so give me very detailed instructions!
So far as I know it is a software problem - there was one early version of the HP49g+ firmware which had a similar battery drain problem (ROM version 1.21, I believe), and this was quickly withdrawn and replaced with a version that did not (ROM version 1.22). I have been unable to find the "broken" version which might be useful for comparison purposes if it could be found.

Thank you for confirming the continued existence of the problem. My 49g+ is back to the HP firmware and I have acquired another HP50g to run newRPL on!

Nigel (UK)
Find all posts by this user
Quote this message in a reply
06-20-2019, 10:29 AM
Post: #508
RE: newRPL - build 1255 released! [official and unofficial]
(06-20-2019 09:17 AM)Nigel (UK) Wrote:  So far as I know it is a software problem - there was one early version of the HP49g+ firmware which had a similar battery drain problem (ROM version 1.21, I believe), and this was quickly withdrawn and replaced with a version that did not (ROM version 1.22). I have been unable to find the "broken" version which might be useful for comparison purposes if it could be found.

Thank you for confirming the continued existence of the problem. My 49g+ is back to the HP firmware and I have acquired another HP50g to run newRPL on!

Nigel (UK)

Well, I wouldn't mind to see the bug solved. It'd be nice to have a backup unit ready, since the HP49G+ can't draw power from the USB port.

I could provide a dump of the bootloader, maybe it could be used to infer where the bug is.
Find all posts by this user
Quote this message in a reply
06-20-2019, 12:49 PM
Post: #509
RE: newRPL - build 1255 released! [official and unofficial]
(06-20-2019 10:29 AM)JoJo1973 Wrote:  
(06-20-2019 09:17 AM)Nigel (UK) Wrote:  So far as I know it is a software problem - there was one early version of the HP49g+ firmware which had a similar battery drain problem (ROM version 1.21, I believe), and this was quickly withdrawn and replaced with a version that did not (ROM version 1.22). I have been unable to find the "broken" version which might be useful for comparison purposes if it could be found.

Thank you for confirming the continued existence of the problem. My 49g+ is back to the HP firmware and I have acquired another HP50g to run newRPL on!

Nigel (UK)

Well, I wouldn't mind to see the bug solved. It'd be nice to have a backup unit ready, since the HP49G+ can't draw power from the USB port.

I could provide a dump of the bootloader, maybe it could be used to infer where the bug is.
I'm afraid that I have no idea of how to go about this. Claudio tried when the bug was first noticed but wasn't able to get anywhere; unless there is someone somewhere who actually knows what peculiarity in the HP-49g+ causes the problem it clearly isn't easy to find.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
06-20-2019, 01:53 PM
Post: #510
RE: newRPL - build 1255 released! [official and unofficial]
(06-20-2019 12:49 PM)Nigel (UK) Wrote:  
(06-20-2019 10:29 AM)JoJo1973 Wrote:  Well, I wouldn't mind to see the bug solved. It'd be nice to have a backup unit ready, since the HP49G+ can't draw power from the USB port.

I could provide a dump of the bootloader, maybe it could be used to infer where the bug is.
I'm afraid that I have no idea of how to go about this. Claudio tried when the bug was first noticed but wasn't able to get anywhere; unless there is someone somewhere who actually knows what peculiarity in the HP-49g+ causes the problem it clearly isn't easy to find.

Nigel (UK)

It's really hard without a unit that fails. I had basically read the status of all pins on a 50g (years ago) and setup newRPL to put the pins in the same state. There's something different in the 49g+ but I can't see what it is since my 49g+ died years ago (first broken plastic ring, then 5 different keys broke, then I took it apart to attempt a fix and died at the operating table).
If I have time this weekend (big if) I'll try to use x49gp with the stock ROM simulating a 49g+ to see if there's any difference in the pins configuration with the 50g and newRPL. Still, I don't promise any positive results, this is hard and I tried before... and failed.
Find all posts by this user
Quote this message in a reply
06-20-2019, 02:06 PM
Post: #511
RE: newRPL - build 1255 released! [official and unofficial]
What about running a diagnostic program on my calc?
Find all posts by this user
Quote this message in a reply
06-20-2019, 02:52 PM
Post: #512
RE: newRPL - build 1255 released! [official and unofficial]
(06-20-2019 01:53 PM)Claudio L. Wrote:  
(06-20-2019 12:49 PM)Nigel (UK) Wrote:  I'm afraid that I have no idea of how to go about this. Claudio tried when the bug was first noticed but wasn't able to get anywhere; unless there is someone somewhere who actually knows what peculiarity in the HP-49g+ causes the problem it clearly isn't easy to find.

Nigel (UK)

It's really hard without a unit that fails. I had basically read the status of all pins on a 50g (years ago) and setup newRPL to put the pins in the same state. There's something different in the 49g+ but I can't see what it is since my 49g+ died years ago (first broken plastic ring, then 5 different keys broke, then I took it apart to attempt a fix and died at the operating table).
If I have time this weekend (big if) I'll try to use x49gp with the stock ROM simulating a 49g+ to see if there's any difference in the pins configuration with the 50g and newRPL. Still, I don't promise any positive results, this is hard and I tried before... and failed.

I'd be very happy to post you my unit (at my expense) for you to dismantle and fiddle with. I realise that the calculator may not survive, but I'm willing to make the sacrifice! Let me know if you'd like this.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
06-21-2019, 01:44 AM
Post: #513
RE: newRPL - build 1255 released! [official and unofficial]
Claudio,

Out of curiosity, what algorithm do the NEXTPRIME and PREVPRIME commands use? I'm trying to program the prime-counting function.
Find all posts by this user
Quote this message in a reply
06-21-2019, 02:58 PM (This post was last modified: 06-21-2019 03:12 PM by Claudio L..)
Post: #514
RE: newRPL - build 1255 released! [official and unofficial]
(06-21-2019 01:44 AM)The Shadow Wrote:  Claudio,

Out of curiosity, what algorithm do the NEXTPRIME and PREVPRIME commands use? I'm trying to program the prime-counting function.

That part is still incomplete but here's how it works:

* All prime numbers up to 122887 are tabulated, so working with small primes is extremely fast.
* The algorithm to test for primality looks for factors by brute force with all prime numbers up to 2^63.
* If a number has prime factors >2^63 the algorithm will (future tense) switch to either Fermat or Miller-Rabin pseudo-primality test, but no algorithm is in place as of right now (it returns that the number is prime if it can't find any prime factors < 2^63).

I still have to come back and code an algorithm for those numbers that have large prime factors (the method as-is will only fail if a number doesn't have any prime factors < 2^63, or < 18 digits long), but I figured it's not a priority since factorization of those large primes typically needs more powerful hardware anyway. But... now that newRPL runs on Android and PC, I should go back and finish the job. I'll add it to the bug tracker.
Find all posts by this user
Quote this message in a reply
06-21-2019, 03:34 PM
Post: #515
RE: newRPL - build 1255 released! [updated to 1261]
All ROMs and Android port were updated to build 1261 with various bug fixes.

Also, the 39gs target is compiled with Thumb mode, which reduced the size and now it CAN be safely flashed again!! It takes 837kbytes, with the only down side of a slight performance penalty.
For example, NQUEENS test by Xerxes runs 0.134 sec instead of 0.106, more than 25% slower but it's a small price to pay vs. not being able to run newRPL at all.
Other targets (40gs and 50g) did not switch to Thumb mode for this reason.

As usual, test, report bugs and over all... enjoy!
Find all posts by this user
Quote this message in a reply
06-22-2019, 03:14 AM
Post: #516
RE: newRPL - build 1255 released! [updated to 1261]
(06-21-2019 02:58 PM)Claudio L. Wrote:  
(06-21-2019 01:44 AM)The Shadow Wrote:  Claudio,

Out of curiosity, what algorithm do the NEXTPRIME and PREVPRIME commands use? I'm trying to program the prime-counting function.

That part is still incomplete but here's how it works:

* All prime numbers up to 122887 are tabulated, so working with small primes is extremely fast.

Aha! I wondered. Is there any way to tap into those tabulated primes?
Find all posts by this user
Quote this message in a reply
06-22-2019, 07:39 PM
Post: #517
RE: newRPL - build 1255 released! [updated to 1261]
(06-21-2019 03:34 PM)Claudio L. Wrote:  All ROMs and Android port were updated to build 1261 with various bug fixes.

Also, the 39gs target is compiled with Thumb mode, which reduced the size and now it CAN be safely flashed again!! It takes 837kbytes, with the only down side of a slight performance penalty.
For example, NQUEENS test by Xerxes runs 0.134 sec instead of 0.106, more than 25% slower but it's a small price to pay vs. not being able to run newRPL at all.
Other targets (40gs and 50g) did not switch to Thumb mode for this reason.

As usual, test, report bugs and over all... enjoy!

Claudio, it looks like the 50g version is corrupted... I've attached a pic of what I get after flashing.    
Find all posts by this user
Quote this message in a reply
06-23-2019, 02:38 AM
Post: #518
RE: newRPL - build 1255 released! [updated to 1261]
(06-22-2019 07:39 PM)JoJo1973 Wrote:  Claudio, it looks like the 50g version is corrupted... I've attached a pic of what I get after flashing.

The file looks OK. Did you use newRPL Desktop to flash it or SD card? Looks like your calc jumped out of place. Try flashing again, and put new batteries just in case. When flashing with newRPL desktop it doesn't check the battery voltage. Perhaps it wasn't sufficient to write to flash successfully.
Also, try the download again, it's not the first time a download gets corrupted.
Find all posts by this user
Quote this message in a reply
06-23-2019, 02:50 AM
Post: #519
RE: newRPL - build 1255 released! [updated to 1261]
(06-22-2019 03:14 AM)The Shadow Wrote:  
(06-21-2019 02:58 PM)Claudio L. Wrote:  That part is still incomplete but here's how it works:

* All prime numbers up to 122887 are tabulated, so working with small primes is extremely fast.

Aha! I wondered. Is there any way to tap into those tabulated primes?

Not sure what you mean by tap into, you get values directly from the table using NEXTPRIME and PREVPRIME. Do you want to know what's the 10th prime or something? The way the table is setup and compressed is for NEXTPRIME and ISPRIME? to turn any number into an index and determine quickly the next prime number. If you are counting primes... you are out of luck with my tables.
Find all posts by this user
Quote this message in a reply
06-23-2019, 03:59 AM
Post: #520
RE: newRPL - build 1255 released! [updated to 1261]
(06-23-2019 02:50 AM)Claudio L. Wrote:  
(06-22-2019 03:14 AM)The Shadow Wrote:  Aha! I wondered. Is there any way to tap into those tabulated primes?

Not sure what you mean by tap into, you get values directly from the table using NEXTPRIME and PREVPRIME. Do you want to know what's the 10th prime or something? The way the table is setup and compressed is for NEXTPRIME and ISPRIME? to turn any number into an index and determine quickly the next prime number. If you are counting primes... you are out of luck with my tables.

Gotcha. Oh well, back to programming it up. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 




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