Post Reply 
Date addition: can it be done in a single HP 65 program card?
01-04-2020, 12:13 AM
Post: #14
RE: Date addition: can it be done in a single HP 65 program card?
I've created 2 HP-65 program cards for the emulator if anyone wants to try them out.

http://www.teenix.org/dates65.zip

cheers

Tony

(01-03-2020 02:33 AM)Dave Britten Wrote:  Alright, I managed to cram pretty much all the functionality of the 67 Standard Pac calendar program into two sides of a single 65 card:

Side 1:
A: Days between dates (calls B on x and y and subtracts the values)
B: Date to day number (Julian date without the 1,720,982 offset added; preserves stack Y register)
C: Date to day of week (calls B then falls through to D)
D: Day number to day of week

Side 2:
A: Day number to date
B: Number of days to weeks+days

The usage is understandably different from the 67 version, e.g. if you want to compute a future/past date, you load side 1, enter the starting date and press B to convert to a day number, add/subtract a number of days, then load side 2, and press A to convert back to a readable date. If you need to compute several offsets from the same date, you can store the day number in R7-R9, which aren't used by side 2, then recall the day number, add/subtract, and convert to a date as many times as needed.

Like the 67 version, it's limited to 1901-2099 due to not calculating leap years correctly for years that are divisible by 100 but not divisible by 400.

I need to test it a bit more, and make the code more readable than my messy notes, then I'll probably add it to the software library forum.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Date addition: can it be done in a single HP 65 program card? - teenix - 01-04-2020 12:13 AM



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