home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / hp48 / 6459 < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.4 KB  |  94 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!think.com!sdd.hp.com!apollo.hp.com!hpwin052!hpqmoea!jdg
  3. From: jdg@hpqtdla.sqf.hp.com (James Gentles)
  4. Subject: Re: HP48 + RPL + stereo system = super duper alarm clock
  5. Sender: news@hpqmoea.sqf.hp.com (SQF News Admin)
  6. Message-ID: <BznM6K.Ks6@hpqmoea.sqf.hp.com>
  7. Date: Tue, 22 Dec 1992 09:25:32 GMT
  8. References: <1h6e7iINN2cn@iskut.ucs.ubc.ca>
  9. Organization: Hewlett-Packard LTD, South Queensferry, Scotland
  10. Lines: 82
  11.  
  12. From HP-28%VM1.NoDak.EDU@hplb.hpl.hp.com Tue Feb 26 11:45 GMT 1991
  13. Received: from vm1.NoDak.edu by hplb.hpl.hp.com; Tue, 26 Feb 91 11:43:54 GMT
  14. From: Pat Corbo <E00159%ICNUCEVM.CNUCE.CNR.IT%VM1.NoDak.EDU@hplb.hpl.hp.com>
  15. Subject:      Easter
  16. To: Multiple recipients of list HP-28 <HP-28@NDSUVM1>
  17.  
  18. The following programme calculateEaster by using Gauss's alghoritme.
  19. The checksum is BB5D.
  20. Input:
  21.     1: Year
  22.  
  23.    EASTER
  24. _______________________________________
  25. :
  26. << CLLCD -> YEAR << YEAR 19 MOD  YEAR :
  27.    4 MOD YEAR 7 MOD 0 0 -> a b c d m  :
  28.    << '19*a +24' EVAL 30 MOD 'd' STO  :
  29.    '5+2*b+4*c+6*d' EVAL 7 MOD d +     :
  30.    'm' STO "EASTER " YEAR ->STR +     :
  31.    1 DISP IF m 9 <= THEN 22 m + ->STR :
  32.    " MARCH" + 2 DISP ELSE m 9 - 'm'   :
  33.    STO IF m 26 == THEN "19 APRIL"     :
  34.    2 DISP ELSE IF m 25 == d 28 == AND :
  35.    THEN "18 APRIL" 2 DISP ELSE m      :
  36.    ->STR " APRIL" + 2 DISP END END :
  37.    END >>  >>                         :
  38. ______________________________________:
  39.  
  40. Based on this HP28 Posting...                       
  41. There follows a HP48 routine to compute Easter It accepts either the year
  42. or the date in current format. Internally the routine uses European format,
  43. dd.mmyyyy, and then at the end checks current format with flag -42, and
  44. changes accordingly using a small routine to swap day and month D<-->M
  45. (Sorry, I haven't included this small routine, its not a big deal) For your
  46. application, you will be changing the IO anyway I guess.
  47. The output is a date in current date format on the stack.
  48. Happy Christmas!
  49. James
  50. ------------------cut here  estr ------------------------------------------
  51. %%HP: T(3)A(D)F(.);       
  52. \<<
  53.   IF DUP 100 >
  54.   THEN 1000000 /
  55.   END .01 MOD DUP
  56. 1000000 * DUP 19
  57. MOD 19 * 24 + 30
  58. MOD DUP 6 * ROT DUP
  59. 4 MOD 2 * SWAP 7
  60. MOD 4 * + + 5 + 7
  61. MOD OVER + \-> d m
  62.   \<<
  63.     IF m 9 \<=
  64.     THEN 22 m + .03 +
  65.     ELSE m 9 - 'm' STO
  66.       IF m 26 ==
  67.       THEN 19.04
  68.       ELSE
  69.         IF m 25 == d 28 == AND
  70.         THEN 18.04
  71.         ELSE m .04 +
  72.         END
  73.       END
  74.     END +
  75.     IF -42 FC?
  76.     THEN D\<-\->M  
  77.     END
  78.   \>>
  79. \>>
  80. ------------------cut here  estr ------------------------------------------
  81.        I have no professional connection with Hewlett-Packard's 
  82.      calculator operations other than as a user of their products.
  83. ------------------------------------------------------------------------
  84.  Opinions expressed are my own, and are not intended to be an official
  85.            statement by Hewlett-Packard Company/Limited
  86. ------------------------------------------------------------------------
  87.   "To strive, to seek, to find, and not to yield."  Ulysses, Tennyson.
  88. ------------------------------------------------------------------------
  89. James Gentles     Hewlett Packard,  Amateur: GM4WZP
  90. Queensferry Telecoms Division QTD,    Email: jdg@hpsqf.sqf.hp.com 
  91. Station Road,   South Queensferry,   HPDESK: James Gentles / HP1400 
  92. West Lothian, Scotland,  EH30 9XR.    Phone: +44 31 331 7663, FAX: ~7488
  93. ------------------------------------------------------------------------
  94.