home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
A-R
/
JULIAN.LBR
/
JULIAN.DZC
/
JULIAN.DOC
Wrap
Text File
|
2000-06-30
|
2KB
|
49 lines
JULIAN.REL contains routines for converting dates from DateStamper
format to Julian, (CP/M 3 style, days since 12/31/77), and from Julian
to binary.
Following are descriptions of each of the routines. Note that the
contents of any registers not explicitly mentioned will be preserved.
JUL2BIN
JUL2BIN converts a 16-bit Julian date to 3 bytes representing
month, day and year.
INPUT: HL contains the Julian date.
OUTPUT: Registers B, C and L contain binary values representing
the month, year and day, respectively. A second copy of the day value is
returned in the A register. The contents of register H are meaningless.
BCD2JUL
This routine converts a 3-byte date in DateStamper format, (BCD
year, month, day) to a 16-bit Julian date. If the year is less than 78,
it is assumed that we mean that year in the next century. The year 2000
*is* a leap year, by the way, and is handled correctly by this routine.
INPUT: HL points to BCD date string.
OUTPUT: HL cotains Julian date. The three bytes in the original
date string are converted from BCD to binary.
BIN2JUL
BIN2JUL is similar to BCD2JUL except that the input date string is
assumed to be in binary rather than BCD.
JBCD2BN
JBCD2BN simply converts a single packed BCD byte to its binary
equivalent.
INPUT: Accumulator contains BCD byte.
OUTPUT: Accumulator contains binary equivalent.