Hi all, I was watching a tv show about an extraordinary man who calculates mentally the day of the week of any date. Then I wrote this program for the HP 35s that uses one of that algorithms.
DAY OF THE WEEK FOR HP 35s (FROM 1901 TO 2099)Table of Contents
=================
1 Using the program
2 Program listing
3 Registers
4 Revision1 Using the program
~~~~~~~~~~~~~~~~~~~~First execute the program: XEQ W ENTER.
Insert the day and press R/S.
Insert the month and press R/S.
Insert the year (from 1901 to 2099) and press R/S.Then it will show a number that corresponds to the
day of the week according to this table:Day Number
-----------+--------
Sunday 0
Monday 1
Tuesday 2
Wednesday 3
Thursday 4
Friday 5
Saturday 62 Program listing
~~~~~~~~~~~~~~~~~~Line Instruction
------+--------------------
W001 LBL W
W002 INPUT D
W003 INPUT M
W004 INPUT Y
W005 033614625035
W006 1E13
W007 10
W008 RCL M
W009 y^x
W010 ÷
W011 ÷
W012 FP
W013 10
W014 x
W015 IP
W016 STO N
W017 RCL Y
W018 4
W019 RMDR
W020 x!=0? ;(not equal)
W021 GTO W038
W022 RCL Y
W023 100
W024 RMDR
W025 x!=0? ;(not equal)
W026 GTO W032
W027 RCL Y
W028 400
W029 RMDR
W030 x!=0? ;(not equal)
W031 GTO W038
W032 RCL M
W033 3
W034 x>y?
W035 GTO W038
W036 1
W037 STO+ N
W038 RCL Y
W039 1
W040 -
W041 ENTER
W042 ENTER
W043 ENTER
W044 100
W045 INT÷
W046 1
W047 +
W048 4
W049 INT÷
W050 -3
W051 x
W052 x<>y
W053 4
W054 INT÷
W055 +
W056 +
W057 RCL N
W058 +
W059 RCL D
W060 +
W061 7
W062 RMDR
W063 STO W
W064 VIEW W
W065 RTN234 Bytes
3 Registers
~~~~~~~~~~~~Register Use Notes
----------+-----------------+----------------
D Day of month
M Month
Y Year
N Modulus Internal usage
W Day of the week
4 Revision
~~~~~~~~~~~06/23/10 - Initial release
Edited: 23 June 2010, 5:29 p.m. after one or more responses were posted