The Museum of HP Calculators

# Advanced BioPac with Hi-res Tricyclic Plot for HP-41C

This program is Copyright © January 11, 1986 by Philippe Legros & Philippe Maryssael and is used here by permission. This program was originally a part of their personal HP-41c library. This program was transcribed by Philippe Legros.

This program is supplied without representation or warranty of any kind. Philippe Legros, Philippe Maryssael and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

## Overview

The "Advanced BioPac with hi-res tricyclic Plot" package is the ideal product for those who are interested in computing biorhythms in lots of different ways: single-day calculation, calculation of high, low and critical dates, and positive and negative periods, one cycle at a time, any two cycles together or all three cycles combined. It can also calculate exact or approximate dates for all curve coincidences.

## Description

From the ancient of the days, philosophers and sages have taught that human happiness lies in harmonious claims to be able to quantitatively gauge the functioning of these three aspects of ourselves: the "physical", "sensitive" and "cognitive".

The biorhythm theory is based upon the assumption that the human body has inner clocks or metabolic rhythms with constant cycle times. Currently, three cycles starting at birth in a positive direction are postulated. The 23-day or physical cycle relates with physical vitality, endurance and energy. The 28-day or sensitivity cycle relates with sensitivity, intuition and cheerfulness. The 33-day or cognitive cycle relates with mental, alertness and judgment.

For each cycle a day is considered either "high", "low" or "critical". The high times (0<x<=1) are regarded as energetic times, you are most dynamic in the cycle. The low times (-1<=x<0) are regarded as the recuperative periods. The critical days (x=0) are regarded as your accident prone days especially for the physical and sensitive cycles.

You've acquired one of the most complete program on biorhythms ever produced so far for the HP-41. It allows you to calculate the following after you have input your birthdate (BD) and today's date (TD): the biorhythms for TD (BIO); the exact and approximate criticals (CRIT), maxima (MAX) and minima (MIN) of the three physical (P), sensitive (S) and cognitive (C) bio-cycles considered separately (e.g. "CRIT FOR P"), two by two (e.g. "MAX FOR SC"), or all three together (e.g. "MIN FOR PSC"); the periods during which your biorhythms are separately, two by two, or all three together, positive or negative (e.g. "POS FOR S, NEG FOR PS").

Also included are a NEXT function to calculate the next biorhythms (TD+1), criticals, maxima, minima, double or treble coincidences, and bio-periods; a DOW (Day Of Week) function for any program-output or user-input legal date; a DM/MD toggle to switch from the Month.-Day-Year format to the Day.-Month-Year one or vice versa; an e/a (exact/approximate) toggle for the criticals, maxima, minima, double and treble coincidences; a P/NP (Print/No Print) toggle for those who have any of the thermal printers available for the HP-41, and -last but not least- a hi-res tricyclic Plot function (PLOT) to plot the biorhythms of the dates considered in the framework of any of the calculation functions listed above, plus seven days before and after them to give the user a clearer insight in his biorhythmical status at that moment.

Moreover, the program is provided with lots of ALPHA comments for enhanced user-friendliness and understandability of the output results.

## Formulae and Procedures

The formula used to calculate the biovalues is:

```BIO = SIN (2 * FRAC (DDAYS / Per) * PI), where
DDAYS is the number of days between your birthdate and today's date
and Per=23 for the physical bio-cycle (P),
28 for the sensitive (S) and
33 for the cognitive (C).
```

The formula used to calculate the slope of your biorhythm (\, /, -) is:

```BIOslope = COS (2 * FRAC (DDAYS / Per) * PI), where
DDAYS and Per are the same as above.

When BIOslope > 0, the sign "/" is used.
When BIOslope < 0, the sign "\" is used.
When BIOslope = 0, the sign "-" is used.
```

The formula used to calculate the exact maxima (+1), minima (-1) and criticals (0) for any of the three bio-cycles, one by one (P or S or C), two by two (PS or SC or PC), or all three together (PSC), as well as the next ones is:

```EXACT (in days from the birthdate) = Start_v + (Repeat_v * n), where:
n is a positive integer (0, 1, 2...), and

Start_v=  Repeat_v=

P   Crit    0        11.5
Max     6        23
Min     17       23

S   Crit    0        14
Max     7        28
Min     21       28

C   Crit    0        16.5
Max     8        33
Min     25       33

PS  Crit    0        322
Max     259      644
Min     385      644

SC  Crit    0        462
Max     371      924
Min     553      924

PC  Crit    0        379.5
Max     305      759
Min     454      759

PSC Crit    0        10626
Max     17003    21252
Min     4249     21252
```

Here follows a schematic summary of the operations carried out to compute the approximate criticals, maxima, minima, double and treble coincidences:

```            Max/Min   Crit

P   Per=     23      11.5
S   Per=     28      14
C   Per=     33      16.5

Max    Inf = RND(Per/4 -1), RND = rounded FIX 0
Sup = INT(Per/4 +1)

Min    Inf = Per - INT(Per/4 +1) = Per - Sup[Max]
Sup = Per - RND(Per/4 -1) = Per - Inf[Max], RND = rounded FIX 0

Crit   Inf = -1
Sup = 1
```

After these operations have been carried out the approximate Max / Min have bio-values comprised between 0.97 and 1.00 in absolute value, and the approximate Crit has bio-values between 0.00 and 0.27 in absolute value.

For the approximate criticals, maxima and minima we compute the first EXACT Crit (cf supra) and then, from the Inf and Sup bounds, determine the Inf and Sup dates, taking into consideration the fact that Inf must be superior to or equal TD. If this condition is not fulfilled, and for the NEXT one, we increment Inf and Sup by Per.

For the double coincidences in approximate mode we compute the first EXACT Crit (cf supra) for the longest period of days of the two cycles considered (Inf1 and Sup1); then we take the shortest one (Inf2 and Sup2) and add Per2 to Inf2 and Sup2 until Inf2<=Sup1 and Sup2>=Inf1. The period is then determined by Max(Inf1, Inf2) and Min(Sup1, Sup2). For the NEXT one, and if the second condition is not fulfilled, we increment Inf1 and Sup1 by Per1 and repeat the second operation.

For the approximate treble coincidences we proceed as for the approximate double coincidences for the two longest periods of days of the three cycles and then take the third one and process likewise.

Here follows a schematic summary of the operations carried out to compute the simple, double and treble Pos / Neg bio-periods:

```            Pos/Neg

P   Per=     23
S   Per=     28
C   Per=     33

Pos    Inf = 1
Sup = RND(Per/2) + Inf -2, RND = rounded FIX 0

Neg    Inf = INT(Per/2) + 1
Sup = RND(Per/2) + Inf -2, RND = rounded FIX 0
```

For the simple Pos / Neg bio-periods we compute the first EXACT Crit (cf supra) and then determine, for the Inf and Sup bounds, the corresponding dates, taking into consideration the fact that Inf must be superior or equal to TD. For the NEXT one we increment Inf and Sup by Per.

For the double Pos / Neg bio-periods we compute the first EXACT Crit (cf supra) for the longest period of days of the two cycles considered (Inf1 and Sup1); then we take the shortest one (Inf2 and Sup2) and add Per2 to Inf2 and Sup2 until Inf2<=Sup1. The period is determined by Max(Inf1, Inf2) and Min(Sup1, Sup2). For the NEXT one we increment Inf1 and Sup1 by Per1.

For the treble Pos / Neg bio-periods we proceed as for the double Pos / Neg bio-periods for the two longest periods of days of the three cycles and then take the third one and proceed likewise.

For the remaining calendar functions used in the program, refer to the HP82182 Time Module Owner's Manual (or the HP-41CX Owner's Manual).

Last but not least comes the hi-res tricyclic PLOT. It is based upon two dates DT1 and DT2, the bounds being DT1 - 7 and DT2 + 7. DT1 and DT2 always refer to the latest user-input or program-output date(s).

In the case the BIO function is combined with NEXT, DT1 = DT and DT2 = DT + NEXT-related incrementation. In the other cases (CRIT, MAX, MIN, POS, and NEG) DT1 is the first output date and DT2 is the second one. Note that DT2 is not displayed if DT1 and DT2 are equal.

As for the PLOT layout, the three bio-values are computed day by day and are converted into a number of columns by calculating:

```BIOposition = RND(78 * (BIOvalue + 1)), RND = rounded FIX 0
```

The three numbers of columns are then reordered from the smallest to the largest. Then the characters ("P", "S" or "C") are accumulated in the printer buffer on the basis of these numbers of columns, except when:

```ABS(column[i] - column[i+1]) <= 3
```

in which case a star symbol ("*") is accumulated, meaning that two or three cycles actually coincide. Moreover, the DT1 (and DT2) bound(s) is / are highlighted by a ">" symbol for enhanced understandability.

## Operating Limits & Warnings

1. This program verifies the validity of all user-input dates. The calendar range expands over a period of almost 2738 years (actually from October 15, 1582 to September 10, 4320).
2. For some functions (actually MAX / MIN FOR PSC in approximate mode) the computer takes up to about 45 seconds to produce some answer. Moreover, plotting out takes more or less 10 seconds for each day.
3. As the FMT printer function is used for formatting some comments on the printout, the HP-IL thermal printer or the infrared thermal printer is required (see section Software information hereunder).
4. When turning your calculator off and then back on you should always execute the BIOPAC initializing function as shutting off causes the various printer-related status flags to be altered.
5. This program contains several non-standard functions which are being dealt with at some length in the HP-41C Synthetic Programming of the museum.

## Examples

The first series of examples are in No-Printout mode and the second series is in Printout mode.

### No Printout

Philippe P.J. Legros, born on December 29, 1962, wants to know his bio-status for March 7 and 8, 1986. He also wishes to get his first two NEG FOR SC, his first MAX FOR P, and his first two CRIT FOR PSC in approximate mode. Then he would like to get, for his 24th birthday, his approximate MIN FOR C as well as his bio-status.

Disconnect the printer if any before running this example.

```KEYSTROKES             OUTPUTS

[XEQ] "SIZE" 020
[XEQ] "BIOPAC"         0.000000
[DM/MD]                M.DY FORMAT
12.291962 [BD]         BD: 12/29/62
3.071986 [TD]          TD: 03/07/86
[BIO]                   03/07/1986
BIORHYTHMS
P= +0.98 (/)
S= +0.22 (\)
C= -0.76 (\)
[NEXT]                  03/08/1986
BIORHYTHMS
P= +1.00 (\)
S=  0.00 (\)
C= -0.87 (\)
[PLOT]                 NO PRINTER
[NEG]                  NEG FOR ?
[SC]                   NEG FOR SC
FROM
03/09/1986
UNTIL
03/18/1986
[NEXT]                 THE NEXT IS
FROM
04/06/1986
UNTIL
04/18/1986
[MAX]                  MAX FOR ?
[P]                    MAX FOR P
TOMORROW
03/08/1986
[DOW]                  SATURDAY
[e/a]                  a RESULTS
[CRIT]                 CRIT FOR ?
[PSC]                  CRIT FOR PSC
ON
04/05/1986
[DOW]                  SATURDAY
[NEXT]                 THE NEXT IS
ON
10/19/1986
12.291986 [TD]         TD: 12/29/86
[MIN]                  MIN FOR ?
[C]                    MIN FOR C
BETWEEN
01/01/1987
AND
01/03/1987
[BIO]                   12/29/1986
BIORHYTHMS
P= +0.73 (/)
S= +0.43 (/)
C= -0.76 (\)
```

### Printout

Philippe A. Ch. L. Maryssael, who was born on March 15, 1962, wants to know his bio-status for March 7, 1986 and the next day. He also wishes to get his first CRIT FOR PS (he asks for a printout and a plot), and his first two POS FOR PSC (with printout for both and plot for the second one).

Turn the HP off, plug the printer in, turn on and switch to MAN mode. Then turn HP back on.

Each time a display is followed by {p} it means the result is also printed out. Each time {p only} is mentioned it means the results only appear on the printer (this applies only to the plot).

```KEYSTROKES             OUTPUTS

[XEQ] "SIZE" 020
[XEQ] "BIOPAC"         0.000000
15.031962 [BD]         BD: 15.03.62
7.031986 [TD]          TD: 07.03.86
[BIO                    07.03.1986
BIORHYTHMS
P= -0.98 (/)
S= -0.97 (/)
C= +0.62 (\)
[PLOT]                 NO PRINT
[P/NP]                 PRINT
[BD]                   BD: 15.03.62   {p}
[TD]                   TD: 07.03.86   {p}
[DOW]                  FRIDAY         {p}
[NEXT]                  08.03.1986    {p}
BIORHYTHMS    {p}
P= -0.89 (/)   {p}
S= -0.90 (/)   {p}
C= +0.46 (\)   {p}
[CRIT]                 CRIT FOR ?
[PS]                   CRIT FOR PS    {p}
IN 258 DYS     {p}
20.11.1986    {p}
[PLOT]                 ...            {p only}
0.000000
[POS]                  POS FOR ?
[PSC]                  POS FOR PSC    {p}
FROM           {p}
11.04.1986    {p}
UNTIL          {p}
12.04.1986    {p}
[NEXT]                 THE NEXT IS    {p}
FROM           {p}
13.06.1986    {p}
UNTIL          {p}
17.06.1986    {p}
[PLOT]                 ...            {p only}
0.000000
```

## User Instructions

1. Load the program:
• See to it that 262 program and data registers are available. This program cannot run if no Time Module has primarily been plugged in
• Optional: plug in any of the HP thermal printers. If you own the HP-82143A thermal printer, you should delete program step 861 (XROM 29,25 or FMT which is not available on that printer)
• Set the adequate SIZE format to run the program:
FUNCTION KEYS: XEQ "SIZE" 020
• Note: In the following the outputs are tagged out with two possible markers: {p} and {p only}. {p} indicates that the outputs both appear on the calculator's display and on the printout; {p only} means the outputs are only plotted out. This note is only applicable if a printer has been plugged in and the Print mode has been chosen by the user ([P/NP] status control function)
2. Initialize the program:
3. Enter your birthdate according to the date format status chosen (Refer to point 12 below):
• INPUT: birthdate
FUNCTION KEYS: [BD]
OUTPUT: birthdate {p}
• Note 1: If no birthdate is entered any subsequent computation function will cause the calculator to display 'BD MISSING'
• Note 2: To recall the birthdate at any time, simply press the [BD] key
4. Enter today's date according to the date format status chosen (Refer to point 12 below):
• INPUT: today's date
FUNCTION KEYS: [TD]
OUTPUT: today's date {p}
• Note 1: Entering a birthdate invalidates today's date in favour of the Time Module-controlled present date. However if you wish to keep today's date, you have to revalidate it by recalling it (by pressing the [TD] key)
• Note 2: Omitting to press the [TD] key after entering your birthdate validates the Time Module-controlled present date for later calculations (e.g. [BIO])
• Note 3: To recall today's date at any time, simply press the [TD] key
5. Compute your biorhythmical status for today's date:
• FUNCTION KEYS: [BIO]
OUTPUT: today's date {p} ... BIORHYTHMS {p} ... P= xx.xx (*) {p} ... S= xx.xx (*) {p} ... C= xx.xx (*) {p}
• Note: xx.xx is the biovalue for the biocycle considered and * is the bioslope of that cycle ("/" and "\" meaning that the biocurve is going upwards and downwards respectively, and "-" meaning that the biovalue considered is at the summit or at the bottom of the biocurve)
6. To calculate the Crit, Max or Min for either the P, S or C biocycles, or the double or treble coincidences of these cycles:
• FUNCTION KEYS: [CRIT] or [MAX] or [MIN]
OUTPUT: ... FOR ?
FUNCTION KEYS: [P] or [S] or [C] or [PS] or [SC] or [PC] or [PSC]
• The results will depend upon the exact/approximate ([e/a]) results mode status (Refer to point 11 below)
• If you are in exact results mode:
OUTPUT: ... FOR ... {p} ... IN n DYS {p} or TODAY {p} or TOMORROW {p} ... date {p}
• If you are in approximate results mode:
OUTPUT: ... FOR .. {p} ... BETWEEN {p} ... date {p} ... AND {p} ... date {p} or ... ON {p} date {p}
• Note 1: If you press e.g. [CRIT] by error, you can thereafter press [MAX] or [MIN] before pressing [P], [S], ...
• Note 2: If you press e.g. [PSC] before e.g. [CRIT] the calculator will display '? FOR PSC'. You HAVE to press either [CRIT] or [MAX] or [MIN] before [P] and so forth
• Note 3: When in exact results mode, it may sometimes occur that a date would be displayed between brackets. This means that this very date is an "intercalary" date. In terms of calendar dates it means the following: for e.g. the 'CRIT FOR P' you have a date every 11.5 days (i.e. the period of 23 days divided by two). But as there is no date between the 11th and the 12th day of the P biocycle, your calculator will display the date just before the accurate (11.5) figure (i.e. 11 days) between brackets, just to indicate there is an intercalary date
7. To calculate the Pos or Neg for either the P, S or C biocycles, or the double or treble coincidences of these cycles:
• FUNCTION KEYS: [POS] or [NEG]
OUTPUT: ... FOR ?
FUNCTION KEYS: [P] or [S] or [C] or [PS] or [SC] or [PC] or [PSC]
OUTPUT: ... FOR ... {p} ... FROM {p} ... date {p} ... UNTIL {p} ... date {p} or ... ON {p} ... date {p}
• Note 1: If you press e.g. [POS] by error, you can thereafter press [NEG] before [P] and so on
• Note 2: If you press e.g. [PSC] before e.g. [POS] the calculator will display '? FOR PSC'. You HAVE to press either [POS] or [NEG] before [P] and so forth
8. The NEXT function is a polyvalent function used to activate the next BIO on one hand, and the next Crit, Max, Min, Pos and Neg on the other, and this in any mode:
• FUNCTION KEYS: [NEXT]
• For the next biorhythmical status, the next date is displayed (and printed out) and then the subsequent outputs are the same as for the [BIO] function (Refer to point 5 above)
• As for the other calculation functions the subsequent outputs are the same
OUTPUT: THE NEXT IS {p} ... {p}
9. The Plot function allows you to plot out the biocurves between two dates as defined in the section of Formulae and Procedures dealing with the Plot
• FUNCTION KEYS: [PLOT]
OUTPUT: ... {p only} 0.000000
• Note 1: If no printer is connected 'NO PRINTER' is displayed
• Note 2: If a printer is plugged in but the no-print mode is on (Refer to point 13 below), 'NO PRINT' is displayed
10. The DOW function allows you to compute and display/plot out the Day Of the Week:
• There are two ways in which the DOW function actually operates. When entering any valid date and pressing the DOW toggle, the date keyed in is formatted and preceded by 'DT: ' on the printout, and the DOW follows. Entering no date and pressing the DOW key causes the calculator to take the date currently appearing on the display/printout and stored in the X stack register for computation of the DOW. If the X register contains no valid date, a 'DATA ERROR' message is displayed
• INPUT: (any valid date)
FUNCTION KEYS: [DOW]
OUTPUT: (DT: formatted date {p only} ...) Day Of Week {p}
11. To switch from the 'exact results' mode to the 'approximate results' mode and vice versa:
• FUNCTION KEYS: [e/a]
OUTPUT: e RESULTS or a RESULTS
• Note: This switch toggle is only applicable for the computation of the [CRIT], [MAX] and [MIN] as defined in the section of Formulae and Procedures
12. To switch from the 'Day.Month.Year'date format mode to the 'Month/Day/Year' one and vice versa:
• FUNCTION KEYS: [MD/DM]
OUTPUT: D.MY FORMAT or M.DY FORMAT
• Note: For date input and output format refer to your Time Module Owner's Manual
13. To switch from the 'no-print'to the 'print' mode and vice versa:
• FUNCTION KEYS: [P/NP]
OUTPUT: NO PRINT or PRINT
• Note: If no printer is plugged in a 'NO PRINTER' message is displayed

## Program Listing

```LINE  KEYS           COMMENTS

01 LBL"BIOPAC"    Initialization of the BioPac (assigned -35)
02  "xxxxxx"        Flags setting, synth instruction, hex F6040800390680
03  FS? 55          Printer available ?
04  "x"           Yes, synth instruction, hex F27F01
05  FC? 55          Printer not available ?
06  "x"           Yes, synth instruction, hex F27F00
07  RCL M           Alpha data to X register, LBL 21
53  RCL 04          Recall today's date + n days (n=0, 1... see NEXT)
54  XEQ 14          (Step 843) format date (dd.mm.yyyy or mm/dd/yyyy)
56  AVIEW           Display (and print if flag 21 is set)
57  PSE             Wait for reading
58  " BIORHYTHMS"   ' BIORHYTHMS' in Alpha
59  3
60  STO 05          3 cycles to compute
61  FIX 2           2 decimals for bio-status (rounding)
62 LBL 07
63  AVIEW           Display (and print if flag 21 is set)
64  PSE             Wait for reading
65  RCL 04          Recall today's date + n days
66  XEQ 04          (Step 255) Compute 2*k*PI = 360*k in degrees
67  ENTER^          Save it
68  SIN             Compute biovalue
69  RND             Rounded to 2 decimals
70  XEQ IND 05      Set Alpha to 'P', 'S' or 'C'
71  "= "          Append '= '
72  X>0?            Biovalue > 0?
73  "+"           Yes, append '+'
74  X=0?            Biovalue = 0?
75  " "           Yes, append ' '
76  ARCL X          Append biovalue
77  " ("          Append ' (', synth instruction, hex F37F2028
78  X<>Y            Recall 2*k*PI
79  COS             Compute bioslope
80  X>0?            Bioslope > 0?
81  "/"           Yes, append '/'
82  X=0?            Bioslope = 0?
83  "-"           Yes, append '-'
84  X<0?            Bioslope < 0?
85  "\"           Yes, append '\', synth instruction, hex F27F5C
86  ")"           Append ')', synth instruction, hex F27F29
87  DSE 05          Next cycle
88  GTO 07          Cycle != last one? Yes, step 062
89  CLST            Clear stack
90  GTO 18          Step 039
91 LBL 03         Set Alpha according to branch of step 070
92  "P"             Code 3 = 'P'
93  RTN
94 LBL 02
95  "S"             Code 2 = 'S'
96  RTN
97 LBL 01
98  "C"             Code 1 = 'C'
99  RTN
100 LBL"PLOT"      Plot (assigned 14)
101  FC? 02          Print available?
102  GTO 24          No, go to step 811: Error message
103  XEQ 11          (Step 819) check if birthdate exists (!=0)
104  FS? 06          Is this after any computation (NEXT enabled)?
105  GTO 00          Yes, go to step 110
106  XEQ 12          No, (Step 828) check today's date (=Time module if none)
107  RCL 02          Recall today's date (in nbr of days)
108  STO 03          Start bound for PLOT
109  ST0 04          End bound for PLOT
110 LBL 00
112  "PLOT OF"       'PLOT OF' in Alpha
113  XEQ 17          (Step 859) Alpha center & print only
114  " BIORHYTHMS"   ' BIORHYTHMS in Alpha
115  PRA             Alpha print only
116  "BETWEEN"       'BETWEEN' in Alpha
117  XEQ 17          (Step 859) Alpha center & print only
118  RCL 03          Start bound
119  7
120  -               7 days before
121  STO 18          DT1=1st day to be plotted, current day to be plotted
122  XEQ 14          (Step 843) format date (dd.mm.yyyy or mm/dd/yyyy)
123  PRA             Alpha print only
124  "AND"           'AND' in Alpha
125  XEQ 17          (Step 859) Alpha center & print only
126  RCL 04          End bound
127  7
128  +               DT2=7 days after = last day to be plotted
129  XEQ 14          (Step 843) format date (dd.mm.yyyy or mm/dd/yyyy)
130  PRA             Alpha print only
131  DDAYS           Last day - 1st day to be plotted
132  STO 19          Store number of days to be plotted -1
134  CF 12           Clear double width flag
135  FIX 0           No decimals
136  SIGN
137  ST+ 19          Add 1 to register 19 = number of days to be plotted
138  CHS
139  ACX             Accumulate -1 in print buffer
140  61
141  SKPCOL          Advance in print buffer by 61 columns
142  CLX
143  ACX             Accumulate 0 to print buffer
144  65
145  SKPCOL          Advance in print buffer by 65 columns
146  "+1"
147  ACA             Accumulate +1 in print buffer
148  PRBUF           '-1 0 +1' print only
149  XEQ 05          (Step 267) '|----------|----------|'print only
150 LBL 19
151  3
152  STO 05          3 cycles to compute
153  14
154  STO 17          Pointer register for saving biopositions & cycle id
155 LBL 08
156  RCL 18          Current day to be plotted
157  XEQ 04          (Step 255) Compute 2*k*PI = 360*k in degrees
158  SIN             Compute biovalue
159   E              synth instruction, hex 1B
160  ST+ 17
161  +
162  78
163  *
164  RND             Convert to bioposition: from 0 (-1) to 156 (+1)
165  5
166  *
167  RCL 05
168  +               Combine bioposition & cycle id
169  STO IND 17      Store it to registers 15 to 17
170  DSE 05          Next cycle<171 GTO 08 Cycle != last one? Yes, step 155 172 RCL 03 No, all is computed and register 5 equal 0 173 RCL 18 Register 5 is used later for incremental (Step 242) 235 LBL 00
236  LASTX           Cycle to be plotted
237  ENTER^          Its id remains unchanged
238  XEQ 06          (Step 279) biovalue plotting routine
239 LBL 01
240  RCL 17          3rd cycle to be plotted
241  ENTER^          Its id remains unchanged
242 LBL 03
243  XEQ 06          (Step 279) biovalue plotting routine
244 LBL 02
245  PRBUF           Send whole graphic line to printer (print only)
246  ISG 18          Current day to be plotted+1
247  ""              NOP instruction, synth instruction, hex F0
248  DSE 19          Number of days to be plotted-1
249  GTO 19          Number of days to be plotted!=0? Yes, step 150 (next day)
250  XEQ 05          (Step 267) '|----------|----------|' print only
251  SF 12           Set double width flag
252  FIX 6           Back to 6 decimal (date entry)
253  CLST            Clear stack
254  RTN             Wait for command
255 LBL 04         Compute 2*k*PI = 360*k in degrees routine
256  RCL 01          Recall birthdate (in nbr of days)
257  -               Subtract it to data date
258  38
259  RCL 05          Current cycle id
260  5
261  *               Convert cycle id to number of days=23, 28 or 33
262  -
263  /               k=ddays/cycle days
264  360
265  *               360*k
266  RTN             End of routine
267 LBL 05         '|----------|----------|' print only routine
268  SIGN
269  SKPCHR          Skip 1 character in print buffer
270  127
271  "-----------"
272  ACCOL           Accumulate '|' in print buffer
273  ACA             Accumulate '-----------' in print buffer
274  ACCOL           Accumulate '|' in print buffer
275  ACA             Accumulate '-----------' in print buffer
276  ACCOL           Accumulate '|' in print buffer
277  PRBUF           Print buffer (print only)
278  RTN             End of routine
279 LBL 06         Biovalue plotting routine
280  5
281  MOD             Extract cycle id from X (0='*', 1='C', 2='S' and 3='C')
282  X<>Y            Swap X and Y
283  LASTX
284  /
285  INT             Extract cycle position from new X
286  X<> 05          Swap current position with previous one
287  RCL 05
288  -               Number of columns to skip = current position - previous one
289  SKPCOL
290  3               Add three more columns to new previous position
291  ST+ 05          (This is the column size of the symbol to be plotted)
292  GTO IND Z       Goto cycle id plotting symbol (step 293, 300, 306 or 313)
293 LBL 00         Cycle id=0 (when 2 or 3 cycles coincide)
294  42
295  ENTER^
296  28
297  ENTER^
298  42              Small star ('*') plotting data
299  GTO 04          (Step 319)
300 LBL 01         Cycle id=1 ('C' cycle)
301  34
302  ENTER^
303  ENTER^
304  62              Small C plotting data
305  GTO 04          (Step 319)
306 LBL 02         Cycle id=2 ('S' cycle)
307  58
308  ENTER^
309  42
310  ENTER^
311  46              Small S plotting data
312  GTO 04          (Step 319)
313 LBL 03         Cycle id=3 ('P' cycle)
314  14
315  ENTER^
316  10
317  ENTER^
318  62              Small P plotting data
319 LBL 04
320  ACCOL           Accumulate 1st column of symbol to print buffer
321  RDN
322  ACCOL           Accumulate 2nd column of symbol to print buffer
323  X<>Y
324  ACCOL           Accumulate 3rd column of symbol to print buffer
325  RTN             End of routine
326 LBL"NEXT"      Next (assigned 15)
327  "ILLEGAL KEY"   'ILLEGAL KEY' in Alpha
328  FC? 06          Is NEXT function available?
329  PROMPT          No, prompt error message and stop
330  RCL 00
331  X!=0?           NEXT function code!=0?
332  GTO 00          Yes, step 336
333  ISG 04          No, previous computation was BIO function: add 1 day
334  ""              NOP instruction, synth instruction, hex F0
335  GTO 21          Compute new BIO, step 052
336 LBL 00
338  "THE NEXT IS"   'THE NEXT IS' in Alpha
339  XEQ 16          (Step 852) Display (and print centered) routine
340  PSE             Wait for reading
341  GTO IND X       Goto NEXT function code (step 342, 344)
342 LBL 01         NEXT function code=1 (exact MIN, MAX or CRIT)
343  GTO 22          (Step 499)
344 LBL 02         NEXT function code=2 (POS or NEG, approximate MIN, ...)
345  FIX 0           0 decimals for POS/NEG (rounding), approximate MIN, ...
346  GTO 23          (Step 649)
347 LBL"MIN"       MIN coincidence (assigned -11)
348  "MIN"           'MIN' in Alpha
349   E              synth instruction, hex 1B
350  CHS             Prefix code = -1
351  GTO 00          (Step 368)
352 LBL"MAX"       MAX coincidence (assigned -12)
353  "MAX"           'MAX' in Alpha
354   E              Prefix  code = 1, synth instruction, hex 1B
355  GTO 00          (Step 368)
356 LBL"CRIT"      CRIT coincidence (assigned -13)
357  "CRIT"          'CRIT' in Alpha
358  .               Prefix code = 0
359  GTO 00          (Step 368)
360 LBL"POS"       POS period (assigned -14)
361  "POS"           'POS' in Alpha
362  2               Prefix code = 2
363  GTO 00          (Step 368)
364 LBL"NEG"       NEG period (assigned -15)
365  "NEG"           'NEG' in Alpha
366  2
367  CHS             Prefix code = -2
368 LBL 00
369  STO 05          Store prefix code to register 5
370  RDN             Restore X
371  XEQ 11          (Step 819) check if birthdate exists (!=0)
372  RDN             Restore X
373  XEQ 12          (Step 828) check today's date (=Time module if none)
374  ASTO L          Store Alpha in LastX register
375  SF 03           Postfix flag is enabled
376 " FOR ?"       Append ' FOR ?'
377  PROMPT          Display message and wait for postfix
378 LBL"PS"        PS cycles (assigned 21)
379  644             Repeat_v
380  "PS"            'PS' in Alpha
381  259             Start_v
382  GTO 00          (Step 392)
383 LBL"SC"        SC cycles (assigned 22)
384  924             Repeat_v
385  "SC"            'SC' in Alpha
386  371             Start_v
387  GTO 00          (Step 392)
388 LBL"PC"        PC cycles (assigned 23)
389  759             Repeat_v
390  "PC"            'PC' in Alpha
391  305             Start_v
392 LBL 00
393  CF 07           Set double cycles id flags (7 cleared, 8 set)
394  SF 08
395  GTO 20          (Step 459)
396 LBL"PSC"       PSC cycles (assigned 24)
397  21252           Repeat_v
398  "PSC"           'PSC' in Alpha
399  17003           Start_v
400  SF 07           Set treble cycles id flags (7 set, 8 set)
401  SF 08
402  GTO 20          (Step 459)
403 LBL"DOW"       Day Of Week (assigned 25)
404  CF 03           Postfix flag disabled
405  DOW             Time Module DOW function (!!! Type it before LBL"DOW" on step 403)
406  LASTX           Restore X
407  FC?C 22         User-input date?
408  GTO 00          No, step 416
409  FC? 21          Print on?
410  GTO 00          No, step 416
412  "DT: "          'DT: ' in Alpha
413  FIX 4           Date format 'dd.mm.yy' or 'mm/dd/yy'
414  ADATE           Append X date
415  PRA             Alpha print only
416 LBL 00
417  XEQ IND Y       Construct Alpha DOW name according to DOW code
418  "DAY"         Append 'DAY'
419  FIX 6           Back to 6 decimal (date entry)
420  GTO 16          (Step 852) Display (and print centered)
421 LBL 00         DOW code=0 -> Sunday
422  "SUN"           'SUN' in Alpha
423  RTN
424 LBL 01         DOW code=1 -> Monday
425  "MON"           'MON' in Alpha
426  RTN
427 LBL 02         DOW code=2 -> Tuesday
428  "TUES"          'TUES' in Alpha
429  RTN
430 LBL 03         DOW code=3 -> Wednesday
431  "WEDNES"        'WEDNES' in Alpha
432  RTN
433 LBL 04         DOW code=4 -> Thursday
434  "THURS"         'THURS' in Alpha
435  RTN
436 LBL 05         DOW code=5 -> Friday
437  "FRI"           'FRI' in Alpha
438  RTN
439 LBL 06         DOW code=6 -> Saturday
440  "SATUR"         'SATUR' in Alpha
441  RTN
442 LBL"P"         P cycle (assigned -21)
443  23              Repeat_v
444  "P"             'P' in Alpha
445  6               Start_v
446  GTO 00          (Step 456)
447 LBL"S"         S cycle (assigned -22)
448  28              Repeat_v
449  "S"             'S' in Alpha
450  7               Start_v
451  GTO 00          (Step 456)
452 LBL"C"         C cycle (assigned -23)  !!! synth instruction, hex C000F20043
453  33              Repeat_v
454  "C"             'C' in Alpha
455  8               Start_v
456 LBL 00
457  SF 07           Set single cycle id flags (7 set, 8 clear)
458  CF 08
459 LBL 20
460  ASTO T          Store Alpha in T register
461  FS?C 03         Postfix flag was enabled?
462  GTO 00          Yes, step 468
463  "? FOR "        No, error message: '? FOR ' in Alpha
464  ARCL T          Append cycle(s) name
465  R^
466  R^              Restore X register
467  PROMPT          Prompt error message and wait for command
468 LBL 00
469  CLA             Clear Alpha
470  ARCL L          Recall prefix Alpha data: coincidence or period name
471  " FOR "       Append ' FOR '
472  ARCL T          Recall postfix Alpha data: cycle(s) name
474  XEQ 16          (Step 852) Display (and print centered) routine
475  SF 06           NEXT function enabled
476  CF 09           Reset intercalary date result display flag
477  GTO IND 05      Branch according to prefix code (Steps 478, 479, 538)
478 LBL 00         Prefix code = CRIT
479 LBL 01         Prefix code = MIN / MAX
480  FS? 01          a results (approximate coincidences)?
481  GTO 01          Yes, step 536
482  RCL 05
483  *               Start_v=Start_v * Prefix code (0=CRIT,-1=MIN,+1=MAX)
484  X!=0?           CRIT coincidence?
485  GTO 00          No, step 489
486  2               Yes, Repeat_v=Repeat_v / 2
487  ST/ Z
488  RDN             Restore stack
489 LBL 00
490  RCL 02          Recall today's date (in nbr of days)
491  RCL 01          Recall birthdate (in nbr of days)
492  -               Ddays
493  R^              Recall Repeat_v
494  STO 07          Store Repeat_v to register 7
495  MOD
496  -               Compute 1st coincidence date according to current Start_v
497  STO 06          Store 1st coincidence date (in nbr of days) in register 6
498  GTO 00          (Step 502)
499 LBL 22         Next function entry point for exact coincidences
500  RCL 07
501  ST+ 06          Add Repeat_v to coincidence date = new coincidence date
502 LBL 00
503  RCL 06
504  X<0?            Coincidence date before today's date?
505  GTO 22          Yes, compute next one (step 499)
506  ENTER^          Save whole date (in nbr of days)
507  INT             Integer part
508  FIX 0           0 decimals for nbr of days
509  X!=Y?           Nbr of days wasn't integer (intercalary date)?
510  SF 09           Set intercalary date result display flag
511  "IN "           'IN ' in Alpha
512  ARCL X          Append nbr of days
513  " DYS"        Append ' DYS'
514  X=0?            Nbr of days=0?
515  "TODAY"         'TODAY' in Alpha
516   E              Prefix  code = 1, synth instruction, hex 1B
517  STO 00          NEXT function code=1 (exact MIN, MAX or CRIT)
518  X=Y?            Nbr of days=1?
519  "TOMORROW"      'TOMORROW' in Alpha
520  XEQ 16          (Step 852) Display (and print centered)routine
521  PSE             Wait for reading
522  X<>Y            Recall nbr of days
523  RCL 02          Recall today's date (in nbr of days)
524  +               Coincidence date=today's date+nbr of days
525  STO 03          Start bound for PLOT
526  STO 04          End bound for PLOT
527  " "             ' ' in Alpha
528  FS? 09          Is it an intercalary date?
529  "("             Yes, '(' in Alpha, synth instruction, hex F128
530  FIX 6           Date format 'dd.mm.yyyy' or 'mm/dd/yyyy'
531  XEQ 15          (Step 846) Nbr of days->date + format + append
532  FS?C 09         Is it an intercalary date?
533  ")"           Yes, append ')', synth instruction, hex F27F29
534  AVIEW           Display (and print if flag 21 is set)
535  RTN             Wait for command
536 LBL 01         Approximate coincidences routine
537  SF 09           Set a results coincidence flag
538 LBL 02         Prefix code=POS/NEG (periods routine)
539  FIX 0           0 decimals = rounding
540  X<>Y            Recall Repeat_v
541  STO 14          Store it as PER1
542  FC? 08          Single cycle (P, S or C)?
543  GTO 00          Yes, step 561
544  33              No, longest cycle=33 days
545  STO 08          Store it as PER3
546  FS? 07          Treble cycles (PSC)?
547  GTO 01          Yes, step 556
548  STO 11          No, double cycles (PS, SC or PC). Store 33 as PER2
549  /               Divide Repeat_v / 33
550  FRC             Check if SC or PC (C=33 days): Result must be integer
551  X!=0?           Was C in the double selected?
552  GTO 01          No, step 556
553  LASTX           Yes, recall Repeat_v / 33. It is 23 or 28, the 2nd cycle
554  STO 14          Store it as PER1
555  GTO 00          (Step 561)
556 LBL 01         Selected : double cycles PS or treble cycles PSC
557  28              2nd longest cycle is 28 days
558  STO 11          Store it as PER2
559  23              Other one is 23 days
560  STO 14          Store it as PER1
561 LBL 00
562  FC? 09          a results coincidence flag clear?
563  GTO 00          Yes, step 571
564  RCL 05          No, recall prefix code (0=CRIT,-1=MIN,+1=MAX)
565  X!=0?           Is it MIN or MAX (prefix code!=0)?
566  GTO 00          Yes, step 571
567  2               No, it is CRIT
568  ST/ 08          PER3 = PER3 / 2
569  ST/ 11          PER2 = PER2 / 2
570  ST/ 14          PER1 = PER1 / 2
571 LBL 00
572  RCL 14          Recall PER1
573  XEQ 06          (Step 699) SUP/INF computation routine
574  STO 13          Store SUP1
575  X<>Y
576  STO 12          Store INF1
577  2
578  STO 00          NEXT function code = 2
579  FC? 08          Single cycle (P, S or C)?
580  GTO 09          Yes, step 593
581  RCL 11          Recall PER2
582  XEQ 06          (Step 699) SUP/INF computation routine
583  STO 10          Store SUP2
584  X<>Y
585  STO 09          Store INF2
586  FC? 07          Double cycles (PS, SC or PC)?
587  GTO 09          Yes, step 593
588  RCL 08          Recall PER3
589  XEQ 06          (Step 699) SUP/INF computation routine
590  STO 07          Store SUP3
591  X<>Y
592  STO 06          Store INF3
593 LBL 09
594  RCL 13          Recall SUP1
595  INT             INT(SUP1)
596  STO 04          Store start_v2 to register 4
597  RCL 12          Recall INF1
598  RND             RND(INF1), rounded to 0 decimals
599  STO 03          Store start_v1 to register 3
600  FC? 08          Single cycle (P, S or C)?
601  GTO 01          Yes, step 668
602  RCL 10
603  RCL 12
604  X<=Y?           INF1<=SUP2?
605  GTO 00          Yes, step 609
606  RCL 11          No, recall PER2
607  ST+ 10          SUP2 = SUP2 + PER2
608  ST+ 09          INF2 = INF2 + PER2
609 LBL 00
610  RCL 13
611  RCL 09
612  X<=Y?           INF2<= SUP1?
613  GTO 00          Yes, step 617
614  RCL 14          No, recall PER1
615  ST+ 13          SUP1 = SUP1 + PER1
616  ST+ 12          INF1 = INF1 + PER1
617 LBL 00
618  RCL 12
619  RCL 09
620  X<Y?            INF2<INF1?
621  X<>Y            Yes, swap them to take the biggest
622  RND             RND(MAX(INF1, INF2)), rounded to 0 decimals
623  STO 03          Store start_v1 to register 3
624  RCL 13
625  RCL 10
626  X>Y?            SUP2>SUP1?
627  X<>Y            Yes, swap them to take the smallest
628  INT             INT(MIN(SUP1, SUP2)
629  STO 04          Store start_v2 to register 4
630  RCL 03
631  X>Y?            start_v1>start_v2?
632  GTO 23          Yes, compute the next one (step 649)
633  FC? 07          Double cycles (PS, SC or PC)?
634  GTO 01          Yes, step 668
635 LBL 10
636  RCL 07
637  RCL 03
638  X<=Y?           start_v1<=SUP3?
639  GTO 00          Yes, step 644
640  RCL 08          No, recall PER3
641  ST+ 07          SUP3 = SUP3 + PER3
642  ST+ 06          INF3 = INF3 + PER3
643  GTO 10          (Step 635)
644 LBL 00
645  RCL 04
646  RCL 06
647  X<=Y?           INF3<=start_v2?
648  GTO 00          Yes, step 654
649 LBL 23         No, next cycle
650  RCL 14          Recall PER1
651  ST+ 13          SUP1 = SUP1 + PER1
652  ST+ 12          INF1 = INF1 + PER1
653  GTO 09          (Step 593)
654 LBL 00
655  RCL 03
656  RCL 06
657  RND
658  X>Y?            RND(INF3)>start_v1? (rounded to 0 decimals)
659  STO 03          Yes, take the biggest: new start_v1=RND(INF3)
660  RCL 04
661  RCL 07
662  INT
663  X<Y?            INT(SUP3)<start_v2?
664  STO 04          Yes, take the smallest: new start_v2=INT(SUP3)
665  RCL 03
666  X>Y?            start_v1>start_v2?
667  GTO 23          Yes, next cycle (step 649)
668 LBL 01
669  RCL 01          Recall birthdate (in nbr of days)
670  ST+ 03          Lower date=birthdate+start_v1
671  ST+ 04          Upper date=birthdate+start_v2
672  RCL 03
673  RCL 02          Recall today's date (in nbr of days)
674  X<Y?            Today's date<Lower date?
675  X<>Y            Yes, take the biggest
676  STO 03          Lower date=MAX(Lower date, Today's date)
677  RCL 04          Recall Upper date
678  "ON"            'ON' in Alpha
679  X=Y?            Upper date=Lower date?
680  GTO 00          Yes, step 694
681  "FROM"          'FROM' in Alpha
682  FS? 09          a results coincidence flag set?
683  "BETWEEN"       'BETWEEN' in Alpha
684  XEQ 16          (Step 852) Display (and print centered) routine
685  PSE             Wait for reading
686  X<>Y            Recall Lower date
687  XEQ 14          (Step 843) format date (dd.mm.yyyy or mm/dd/yyyy)
688  AVIEW           Display (and print if flag 21 is set)
689  PSE             Wait for reading
690  "UNTIL"         'UNTIL' in Alpha
691  FS? 09          a results coincidence flag set?
692  "AND"           'AND' in Alpha<693 X<>Y Recall Upper date 694 LBL 00
695  XEQ 16          (Step 852) Display (and print centered) routine
696  PSE             Wait for reading
697  XEQ 14          (Step 843) format date (dd.mm.yyyy or mm/dd/yyyy)
698  GTO 18          Step 039
699 LBL 06         SUP/INF computation routine
700  STO 04          Store PER
701  RCL 02          Recall today's date (in nbr of days)
702  RCL 01          Recall birthdate (in nbr of days)
703  -               Substract it from today's date
704  STO 03          Store ddays
705  RCL 04          Recall PER
706  /               ddays / PER
707  INT             INT(ddays / PER)
708  *               PER * INT(ddays / PER)
709  STO 06          Store 1st exact CRIT
710  RCL 05          Recall prefix code (0,-1,1,2,-2)
711  FC? 09          a results coincidence flag clear?
712  GTO 00          Yes, step 751
713  X<0?            Prefix code<0 (approximate MIN)?
714  SF 10           Yes, set MIN/NEG flag
715  X=0?            Prefix code=0 (approximate CRIT)?
716  GTO 01          Yes, z=0 (step 727)
717  CLX             Lock stack
718  RCL 04
719  4
720  /               z = PER / 4
721  FC? 10          MIN flag clear?
722  GTO 01          Yes, step 727
723  INT
724  RCL 04
725  X<>Y
726  -               z = PER - INT(PER / 4)
727 LBL 01
728  RND             RND(z)
729  +               1st exact CRIT + RND(z)
730   E              synth instruction, hex 1B
731  -               1st exact CRIT + RND(z) -1
732  RCL 06          Recall 1st exact CRIT
733  RCL 05          Recall prefix code (0,-1,1,2,-2)
734  X=0?            Prefix code=0 (approximate CRIT)?
735  GTO 01          Yes, z2=0 (step 746)
736  CLX             No, lock stack
737  RCL 04
738  4
739  /               z2 = PER / 4
740  FC?C 10         MIN flag clear? (and reset it)
741  GTO 01          Yes, step 746
742  RND
743  RCL 04
744  X<>Y
745  -               z2= PER - RND(PER / 4), rounded 0 decimals
746 LBL 01
747  INT
748  +               z5=1st exact CRIT + INT(z2)
749   E              z4=1, synth instruction, hex 1B
750  GTO 01          Step 772
751 LBL 00         POS / NEG computation
752  X>0?            Prefix code>0 (POS periods)?
753  CLX             Yes, prefix code=0
754  X=0?            Prefix code=0 (POS or CRIT periods)?
755  GTO 00          Yes, z3=0 (step 761)
756  CLX             Lock stack
757  RCL 04
758  2
759  /
760  INT             z3= INT(PER / 2)
761 LBL 00
762  +
763   E              synth instruction, hex 1B
764  +               z5=1st exact CRIT + z3 + 1
765  RCL X           Duplicate X in Y
766  RCL 04
767  2
768  /
769  RND
770  2
771  -               z4=RND(PER / 2)-2, rounded 0 decimals
772 LBL 01
773  +               z6=z4+z5
774  RCL 03          Recall ddays
775  X<=Y?           ddays<=z6?
776  GTO 00          Yes, step 781
777  RCL 04          No, recall PER
778  ST+ Z           Add PER to SUP
779  ST+ T           Add PER to INF
780  RDN             Roll stack
781 LBL 00
782  RDN             Roll stack to get SUP in X and INF in Y
783  RTN             End of routine
784 LBL"e/a"       exact/approximate results (assigned -24)
785  FC?C 01
786  SF 01           Toggle e/a results flag
787  "e"             'e' in Alpha
788  FS? 01          a results (approximate coincidences)?
789  "a"             Yes, 'a' in Alpha
790  " RESULTS"    Append 'RESULTS'
791  PROMPT          Prompt message and wait for command
792 LBL"DM/MD"     Day.MonthYear / Month.DayYear format (assigned -25)
793  FC?C 00
794  SF 00           Toggle DM/MD format flag
795  MDY             Select MDY Time Module format
796  FC? 00          DM format selected?
797  DMY             Yes, select DMY Time Module format
798  "D.M"           'D.M' in Alpha
799  FC? 31          Is MDY format selected?
800  "M.D"           Yes, 'M.D' in Alpha
801  "Y FORMAT"    Append 'Y FORMAT'
802  PROMPT          Prompt message and wait for command
803 LBL"P/NP"      Print/No Print mode (assigned -35)
804  FC? 55          Printer connected?
805  GTO 24          No, step 811
806  FC?C 02
807  SF 02           Toggle software print/no print flag
808  CF 21           Clear system print flag
809  FS? 02          Print selected?
810  SF 21           Yes, set system print flag
811 LBL 24
812  "NO "           'NO ' in Alpha
813  FS? 02          Print selected?
814  CLA             Yes, clear Alpha
815  "PRINT"       Append 'PRINT'
816  FC? 55          Printer connected?
817  "ER"          No, append 'ER'
818  PROMPT          Prompt message and wait for command
819 LBL 11         Check if birthdate exists (!=0) routine
820  CF 03           Postfix flag disabled
821  CF 22           User-entry flag disabled
822  RCL 01          Recall birthdate (in nbr of days)
823  X!=0?           Already entered date (!=0)?
824  RTN             Yes, end of checking routine
825  RDN             No, restore stack
826  "BD MISSING"    'BD MISSING' in Alpha
827  PROMPT          Prompt error message and wait for command
828 LBL 12         Check today's date routine (=Time module if none)
829  FC?C 05         User-input already done?
830  RTN             Yes, end of checking routine
831  DATE            No, recall Time Module today's date
832  XEQ 13          Convert it to nbr of days (step 836)
833  STO 02          Store it
834  LASTX           Restore stack
835  RTN             End of checking routine
836 LBL 13         Check date validity routine + nbr of days conversion
837  DOW             Time Module checking (!!! Type it before LBL"DOW" on step 403)
838  9.094
839  LASTX
840  DDAYS           Nbr of days conversion
841  CF 06           NEXT function disabled
842  RTN             End of checking routine
843 LBL 14         Format date routine (dd.mm.yyyy or mm/dd/yyyy)
844  " "             ' ' in Alpha
845  FIX 6           dd.mm.yyyy or mm/dd/yyyy date format
846 LBL 15         Nbr of days to date conversion routine
847  9.094
848  X<>Y
849  DATE+           Conversion to date
850  ADATE           Append date in Alpha
851  RTN             End of routine
852 LBL 16         Display (and print centered) routine
853  FC? 21          Print mode?
854  AVIEW           No, display message
855  FC?C 21         Print mode? + clear flag
856  RTN             No, end of routine
857  AVIEW           Yes, display message (system print flag clear)
858  SF 21           Set system print flag again
859 LBL 17         Alpha center & print only routine
860  ACA             Accumulate Alpha in print buffer
861  FMT             Format print buffer for a centered output
862  PRBUF           Send print buffer for printing
863  END             End of routine
```

## Software Information

### System Configuration

```HP-41C + Quadram + Time Module or
HP-41CV + Time Module or
HP-41CX

Printer:

HP-82143A ("FMT" function at step 861 should be deleted) or
HP-82162A + HP-IL (HP-82160A) or
HP-82240A + IR Module (HP-82242A)
```

### Program Status

```SIZE 020
TRIG MODE: DEG
USER MODE: ON (should be set before loading the program in order to keep the assignments)
NUMBER OF PROGRAM STEPS: 863
NUMBER OF PROGRAM BYTES: 1693
TOTAL NUMBER OF REGISTERS (program+data): 262
NUMBER OF MAG SIDES (card reader): 16
```

### Overlay

```MIN (-11)    MAX (-12)    CRIT (-13)   POS (-14)    NEG (-15)
BD (11)      TD (12)      BIO (13)     PLOT (14)    NEXT (15)

P (-21)      S (-22)      C (-23)      e/a (-24)    DM/MD (-25)
PS (21)      SC (22)      PC (23)      PSC( 24)     DOW (25)

P/NP (-35)
BIOPAC (35
```

### Data Registers

```R00 = NEXT pointer
R01 = BD (in nbr of days)
R02 = TD (in nbr of days)
R03 = Used for PLOT + scratch
R04 = Used for PLOT + scratch
R05 = scratch
R06 = INF3 + scratch
R07 = SUP3 + scratch
R08 = PER3
R09 = INF2
R10 = SUP2
R11 = PER2
R12 = INF1
R13 = SUP1
R14 = PER1
R15 = Cycle 1 for PLOT
R16 = Cycle 2 for PLOT
R17 = Cycle 3 for PLOT
R18 = Nbr of days for PLOT
R19 = days left to be plotted
```

### Flags (S=Set,C=Clear)

```F00 = C = M.DY format if S, D.MY format if C
F01 = C = a results if S, e results if C
F02 = C = print if S, no print if C
F03 = C = postfix enabled if S, postfix disabled if C
F04 = C = not used
F05 = S = Time Module TD if S, User-input TD if C
F06 = C = NEXT enabled if S, NEXT disabled if C
F07 = C = P/S/C or PSC if S, PS/SC/PC if C
F08 = C = PS/SC/PC or PSC if S, P/S/C if C
F09 = C = intercalary date or a results coincidence if S,
exact date or e results coincidence if C
F10 = C = MIN (a results) if S, MAX (a results) if C
F12 = S = double width if S, simple width if C
F21 = C = print if S, no print if C
F22 = C = enter BD/TD/DOW if S, recall BD/TD/DOW if C
F26 = S = Audio enable
F27 = S = User mode (assignments) if S
F28 = S = Decimal point used
F29 = C = No seperators
```

## References

• "Biorhythms" (GA-19A, HP-67/97 Games Pac), ref. 00191D (Corvallis)
• "Biorythms: Double and Treble Critical Dates" (HP-67/97) by Laurence Hill, Edinburgh, UK, ref. 51489D (UPLE)
• "Biorythmes" from "HP-19c/29c Manuel d'Applications", pp 53-55 (French)
• "Biorythms" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 60981D (UPLE)
• "Biorythmes" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 70233D (UPLE) (French)
• "Bioritmus" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 90032D (UPLE) (Dutch)
• "Coincidences of Biorythmic Cycles" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 60979D (UPLE)
• "Coïncidences des Cycles biorythmiques" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 70244D (UPLE) (French)
• "Coïncidenties van Biorithmische Tijdkringen" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 90033D (UPLE) (Dutch)
• "Biorythms: Positive and Negative Mono-cyclic Periods" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, personal library
• "Biorythms: Coincidences Of Biorythmic Cycles (approximate results for PS, SC and PC)" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, personal library
• "Biorythms: Coincidences Of Biorythmic Cycles (approximate results for PSC)" (HP-67/97) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, personal library
• "Biorythms for HP-19c/29c (revised)" by Philippe Legros, personal library
• "Biorhythms for HP-67" by Philippe Legros and Philippe Maryssael, personal library
• "Bio" (HP-41c) by Amel D. Yarid, Washington DC, USA, ref. 00406C (Corvallis)
• "Biorhythms and Coincidences" (HP-41c) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 02037C (Corvallis)
• "Biorythmes" (HP-41c) by Philippe Legros and Philippe Maryssael, personal library (French)
• "Advanced Bio-Pac" (HP-41c) by Philippe Legros and Philippe Maryssael, Brussels, Belgium, ref. 02792C (Corvallis)
• "Synthetic Programming On The HP-41c" by William C. Wickes, Larken Publications, 1980
• "PPC Journal", Vol 8 No 6, Aug-Dec 1981, pp 19-21: "An Introduction To Synthetic Programming And The Byte Table"
• "HP-41 Synthetic Programming Made Easy" by Keith Jarett, Synthetix, 1982
• "PPC ROM Users Manual", 1981