Dec 062017
Complete Julian Date functions in ASM, excellent!.
File JULIAN-A.ZIP from The Programmer’s Corner in
Category Assembly Language
Complete Julian Date functions in ASM, excellent!.
File Name File Size Zip Size Zip Type
JT.COM 2032 1510 deflated
JULIAN.COM 2477 1776 deflated
JULIAN.DOC 6422 2367 deflated
JULIAN.THD 18036 6822 deflated
JULIAN.ZIP 15733 15297 deflated
TPCREAD.ME 199 165 deflated

Download File JULIAN-A.ZIP Here

Contents of the JULIAN.DOC file


A set of assembler routines for Julian Day calculations with examples
Software for the public domain 1989 by Charles Lazo III

This package contains the following files:

JULIAN.DOC -- This file

JULIAN.COM -- A program to illustrate
the use of the Julian Day
assembler library

JT.COM -- A program that tests the
Julian Day routines by
cross checking the routines
against each other

JULIAN.THD -- A message thread from the
CompuServe IBMPRO forum that
prompted my creation of these
routines and which defines
the meaning of the Julian Day

JULIAN.SRC -- A file in archive format that
contains the assembly language
source code for the Julian Day
conversion routines

The Julian Day corresponding to a given moment is defined as the number of
days that have elapsed from 12:00 noon on 1-Jan-4713 B.C. to that moment.
It is expressed as an integral number of days plus a decimal fraction. The
Julian Day as it is referred to with these programs is the value of the
Julian Day on a given date at 12:00 noon Universal Time.

These conversion routines support the conversion of Julian Days to dates in
both the Julian and Gregorian Calendars for all dates in A.D. times between
the dates 1-Jan-1 and 19-Dec-22666 corresponding to Julian Days in the range
1721424 - 9999999. No support is given to B.C. dates with this version 1.0.

Some pertinent information is: The Julian calendar began on Saturday,
January 1, 45 B.C. Gregory decreed that the last day of the Julian era
would be Thursday, October 4, 1582 A.D. and the following day would be
Friday, October 15, 1582 A.D., the first day of the Gregorian calendar.
Thus the 10 days from 5-Oct-1582 to 14-Oct-1582 are not included in either
calendar and have no associated Julian Day.

Of the two .COM programs included in this package the only one likely to be
interesting to anyone but assembly language programmers is JULIAN.COM. This
program converts dates in the format dd-mmm-yyyy (e.g., 27-Mar-1989) or the
format dd-mmm-yy (e.g., 27-Mar-89) to a Julian Day in the above mentioned
range. Or a Julian Day in that range to the corresponding date in one of
the two calendars, Julian or Gregorian. Type "julian" at the DOS prompt
and a short message of syntax is displayed. The only item not mentioned in
that message is the means of changing the program to and from the two date
formats supported: dd-mmm-yy and dd-mmm-yyyy. To set the century to the
twentieth century so that yy in the format dd-mmm-yy will mean dates with
years in the range 1900 - 1999 simply enter "julian 1900". If that is done
then from then on (until another century offset is assigned) the number 1900
will be assumed to be the century for the dd-mmm-yy format. What happens is
that internally the number 1900 is automatically added to yy numbers placing
them in the 1900 - 1999 range (or 1900 is subtracted from the yyyy year
numbers that result from a Julian Day conversion). To return to the default
dd-mmm-yyyy format enter "julian 0000". Note that although the largest year
number supported is 22666 only four digit century numbers can be used. Also
you must be running a DOS version of 3.0 or later. The century number is
actually written to the JULIAN.COM file so it must not be write protected.
Any time an input error is detected by the JULIAN program the syntax message
is displayed. Although there are four specific error numbers returned by
the conversion routines none of them are used to provide specific feedback
to the user as to what the error was.

The other .COM program, JT.COM, is one that tests the conversion routines
against one another for the whole range of supported Julian Days. The
program starts by converting the number 1721424 to the corresponding date
and then converting that date back to a Julian Day. It then compares the
two Julian Day numbers. If the test succeeds then the next Julian Day
number in sequence is tested, etc. up to the largest number supported,
9,999,999. If for any number the test fails, the computer beeps and then
displays the Julian Day number for which the test failed. The program was
used to debug the conversion routines and since they passed the JT test
it is known that the two routines are exact inverses of each other. Since
the two routines were coded separately and do not share the same logic it
is highly probable that there are no errors remaining. JT is included in
this release both as another example of how the conversion routines are used
and as a means of maintaining the fidelity of the library. If a programmer
wishes to alter the routines (for example only the tiny model is supported
so changes that allow the support of another memory model would need to be
validated), then JT would be a handy thing to have.

MAKE files that work with TASM are included in the JULIAN.SRC archive and
also the batch file MJ.BAT that will build both JULIAN.COM and JT.COM. Few
changes would be needed to support another MAKE, but if not used at least
the files JULIAN and JT demonstrate how to manually build the programs.

I would like to express my thanks to Gary Miller who inspired me to create
these routines and to Dr. Howard Freidman who has been a constant source of
information to me on these matters as well as everyone who participated in
the IBMPRO forum discussion on the Julian Day.

Charles Lazo III 4-Apr-1989
P.O. Box 452
Hohenwald, TN 38462

CIS User ID 72210,17

 December 6, 2017  Add comments

Leave a Reply