hp41programs

Pessah

The Jewish Pessah for the HP-41


Overview
 

-The following program calculates the date of the Jewish Passover ( 15 Nissan ) in a given year  YYYY  of the Julian or Gregorian Calendar.
-It uses a formulae due to Gauss, given by Jean Meeus in "Astronomical Algorithms" - Second Edition.
 

Program Listing
 
 

Data Registers:   R00 thru R05: temp
Flag:   F04            CF 04  to get the date in the Gregorian Calendar
                              SF 04  to get the date in the Julian Calendar
Subroutines: /
 

-I've used the M-Code routine  FLOOR   which can be replaced by   RCL X   1   MOD   -
 
 

  01  LBL "PESAH"
  02  INT
  03  STO 00
  04  1
  05  %
  06  FLOOR 
  07  3
  08  *
  09  5
  10  -
  11  4
  12  /
  13  FLOOR  
  14  FS? 04
  15  CLX
  16  STO 01
  17  RCL 00
  18  4
  19  MOD
  20  STO 02
  21  LASTX
  22  /
  23  +
  24  RCL 00
  25  12
  26  ST* Y
  27  +
  28  19
  29  MOD
  30  STO 03
  31  1.554241797
  32  *
  33  +
  34  RCL 00
  35  314.6837061
  36  /
  37  -
  38  1.904412362
  39  -
  40  STO 04
  41  FLOOR  
  42  ST- 04
  43  STO 05
  44  RCL 00
  45  3
  46  *
  47  +
  48  RCL 02
  49  5
  50  *
  51  +
  52  2
  53  +
  54  RCL 01
  55  -
  56  7
  57  MOD
  58  STO 01
  59  X=0?
  60  GTO 01        
  61  2
  62  MOD
  63  X=0?
  64  ISG 05
  65  CLX
  66  SIGN
  67  RCL 01
  68  X#Y?
  69  GTO 02
  70  6
  71  RCL 03
  72  X<=Y?
  73  GTO 02
  74  RCL 04
  75  .63287037
  76  X>Y?
  77  GTO 02
  78  2
  79  ST+ 05
  80  GTO 02
  81  LBL 01
  82  11
  83  RCL 03
  84  X<=Y?
  85  GTO 02
  86  RCL 04
  87  .897723765 
  88  X<=Y?
  89  ISG 05
  90  LBL 02
  91  5
  92  RCL 05
  93  22
  94  +
  95  61
  96  X<Y?
  97  GTO 01
  98  DSE Z
  99  CLX
100  31
101  X<Y?
102  GTO 01
103  DSE Z
104  CLX
105  LBL 01        
106  -
107   E2
108  /
109  +
110  1
111  %
112  RCL 00
113  SIGN
114  *
115  RCL 00
116  +
117  END

 
   ( 200 bytes / SIZE 006 )
 
 

      STACK        INPUTS      OUTPUTS
           X         YYYY   YYYY.MNDD
           L             /        YYYY

-Execution time = 4 seconds

Examples:

  CF 04    9999   XEQ "PESAH"  >>>>   9999.0525         9999   May  25th              ( Gregorian Calendar )
  CF 04    2010            R/S           >>>>   2010.0330         2010  March 30th             ( Gregorian Calendar )
  SF 04    -234             R/S           >>>>   -234.0416         235 BC  April  16th               ( Julian Calendar )

Notes:

-The method described in reference [1] actually involves 14 digit numbers.
-So, I first wrote a program that used the complete coefficients, using multiprecision arithmetic.
-Then - thanks to Warren Furlow's V41 - I compared the outputs produced by these 2 programs:
  It yields the same results, at least for all the years between -9999 and +9999, both in the Julian & Gregorian Calendars,
  except for one year:  -7601  i-e  7602 B.C.

-Lines 91 to 106 assume that the result is between March 1st and May 31th
-In fact, the dates fall between March 1st and April 30th for all years between -3971 & +3429 ( Gregorian Calendar CF 04 )
  and between -3922 & +6116 ( Julian Calendar SF 04 )
-So, 8 bytes will be saved if you replace line 91 by 4 and if you delete lines 95 to 99.

-The year number in the Jewish Calendar = YYYY + 3760
 

Reference:

[1]   Jean Meeus - "Astronomical Algorithms" - Willmann-Bell  -  ISBN 0-943396-61-1