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.

Meeting Garth and Joe at our “mini HHC” (the yearly HP Handheld Club is in the autumn). Great to meet with some fellow geeks and talk HP calculators. Yeay!
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 moon going through its phases
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 π
Geek
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? π
Oh, yes!
. . . and they just keep on rollin’ in!
“as a side effect”… π
Yep, that’s the point! (IMHO)
Cheers from Caribbean.
Diego.
Hey! Diego π
How are you doing? Any new projects in the pipeline?
Hi Geir,
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.
Geir, Chris,
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.
Best wishes.
π
Just found this a couple years late, but you seem to have a bug:
049 23.062013
050 DATE
051 DDAYS
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:
059 29.53058885
060 MOD
061 14.76529443
Can be changed to:
059 29.53058885
060 MOD
061 LASTx
062 2
063 /
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)
050 DATE
051 DDAYS
052 .35
053 +
054 TIME
055 HR
056 24
057 /
058 +
059 29.53058885
060 MOD
061 LASTx
062 2
063 /
064 STO Z
065 –
066 XY
067 /
068 100
069 *
etc..
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!