I’ve had this simple program on my HP-41 for years, “CLR”. It clears the registers, stack and Alpha as well as setting the correct flags and time/date formats. It also checked to see if the clock had been reset (as it does when the battery runs out) and prompts for Time and Date if it has.
On my trip to the US, I met with Joseph Horn and Garth Wilson. And it was from Garth I got the idea to extend my CLR program to include a simple status line with the current week number, the current moon phase (percentage of illumination of the moon) as well as the time remaining to the next upcoming alarm, if any.
The program is simply run by XEQ “CLR”. This clears all register, stack and Alpha as well as setting the right combinations of flags. It returns with zero in the display. If you press R/S it will prompt for “DATE^TIME” if the clock has been reset (DATE, Enter, TIME) and then display a status line: (ALARM) WEEK# MOON% – Example: “01:32 27 -35%” which shows it is 1 hour and 32 minutes till the next alarm goes off (no such number if there are no future alarms), it is week #27 and the moon is illuminated 35% and it is waning (a positive number means the phase is waxing/growing). Pressing R/S again shows the running clock (the CLOCK command). You can also access the status line (and then the clock by pressing R/S) by XEQ “STATUS” without having to clear registers, stack and Alpha first (thanks Anette).
Here’s the program listing.
Hope this is of use to someone 🙂
34 thoughts on “HP-41: CLR & STATUS”
Geek? Hmmm…not exactly…in my opinion these kind of things helped humanity to move forward, to progress.
Geeks do just that.. as a side effect of having unadulterated fun 😉
I am amazed I got even one reply to this blog post.
Why? History doesn’t mean only World War II or French Revolution. It can be also HP-41, or Macintosh, or first IBM machines…
damn Dragos! You are seriously geekified!
LOL! You kidding?!? Everyone is interested in the CLR button on an HP-41! hahaha
Funny, I read your comment a bit too fast, dragos. I read:
he he…who knows? maybe it helps also humidity to move forward!!! 🙂
You’re just envious 🙂
I have a spare HP-41CX if you need it and twist my arm.
Cute. You’re weclome! I’m glad I inspired you to set up an XEQ “STATUS” function on this program. You never know when someone could ask you what week number it is. Then you can rapidly give an answer without clearing the registers, stack and Alpha. 😀
Yup, a much needed improvement 🙂
LOL! This may be the funniest blog post to this number week yet! hahaha
You really had me going Anette! I thought you were this sleek, sophisticated, hot Euro chick but now I find out you are really Geek Squad at heart? . Wow. . . wow. . . LOL
Ha ha ha, how could you possible guess?! 😀
You missed this, Geir: http://en.wikipedia.org/wiki/Computer_History_Museum
Maybe on your next US trip, who knows? 🙂
. . . and they just keep on rollin’ in!
“as a side effect”… 🙂
Yep, that’s the point! (IMHO)
Cheers from Caribbean.
Hey! Diego 😀
How are you doing? Any new projects in the pipeline?
I’m fine, thanks; a bit too busy due to my new life in the Caribbean side of the Atlantic, but enjoing it at most… 😉
There are no real “new” project in the HP-41 field, but some improvements in the Clonix and NoV’s: Clonix-41 to run at real 2.1x (really low power achieved by reducing the running time by 50%… 🙂 and the suggested (by Ángel and Michael) feature that allow ROM blocks 0 & 1 to be joined on Clonix-D and NoV-64, mostly handle the multi-banked ROM’s from Ángel.
Once these two “upgrades” are published I can put some effort in the USB-41 bidirectional comms… this should be a really new enhancement (hopefully).
All the best.
Would be really cool to see a bidirectional USB-41. Set aside one for me 🙂
I liked this post. I kind of really followed it! Thank you Diego.
Thank you too, and all the HP-41 enthusiasts who have shown me their support along these years. Hope we can continue enjoing these wonderful devices in the years to come.
Just found this a couple years late, but you seem to have a bug:
Line 49 is supposed to be a date, but there is no month 23. is it supposed to be 2? 3? 12? Or should it be 06.232013?
I use the date format DMY. Thanks for reminding me to point that out.
Thanks, I should have noticed that in your listing!
I notice that the Linux “pom” program, and an app I have on my iPhone both agree on the moon phase %, but your algorithm lags those by 4-5%
Did you come up with that algorithm on your own? It looks like it is using the date June 23, 2013 as a starting date. To get it back in sync with the other 2 programs I tried, should I just fudge the starting date until it produces the correct phase? Or would it be better to adjust one of the other values instead?
Yes, find a newer and better date/time and it should get back in sync. Please provide the changed steps in the program so I can fix the listing.
Cool to have your input and contribution 🙂
And regarding the algorithm – it’s out of Wikipedia and some other sources. Pretty straight forward, really.
OK, I’ve got it a little better. I’m not 100% sure exactly what the moon phase is right now. One phone apps says 87%, and another says 86%
I notice your program has 2 numbers, one exactly twice the other. That can be simplified using LASTx.
These 3 lines:
Can be changed to:
A start date of April 3, 2015 seems to work good, even though I think April 4 was full moon. This gives an answer of 86.5% right now.
049 03.042015 (I use 4.03.2015, since I use MDY format)
064 STO Z
Awesome. I will change the listing (and the program on my 41) in a couple of days when I get some nerd time.
You might want to hold off a bit… replacing the 0.5640972221 with 0.35 on line 52 wasn’t a good move on my part. It produced a “waning” value when the moon is still waxing.
This has gotten me intrigued enough that I found the source for the Linux (BSD Unix) “pom” program that displays the phase of the moon in a single line of text, and converted it to run on the HP-71B in BASIC (because it’s more fun than recompiling the C code on a PC of course! 🙂
I am playing around with that a bit, and may try to convert it to the HP41CX at some point. But no sense in changing your listing yet, as my corrections to your algorithm didn’t work so well near full moon!