home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / zsys / znode-12 / s / z3help13.lbr / DSLIB.HZP / DSLIB.HLP
Encoding:
Text File  |  1993-06-12  |  20.3 KB  |  529 lines

  1.  System Identity      - TIMINI, GETDOS, FINDCK, CKTDF
  2.  Clock Reading        - RCLOCK, RDCLK
  3.  File Stamp Routines  - GSTAMP, PSTAMP, GETTD, SETTD
  4.  Directory Selection  - DDIRQS, DDIRQ, DDIRNPAK, DDIRPAK, DDIRSEL
  5.  Time Conversions     - U2PTIM, P2UTIM, U2MTIM, M2UTIM
  6.  Utility Routines     - FSTNXT, BCD2BIN, BIN2BCD, DVERS
  7.  DateStamper(tm) T&D  - OPENTD, CLOSTD, RWTD
  8. :                     System Identity 
  9.  
  10. TIMINI - See if there is a Clock we can read.
  11.  
  12.   ENTER: None
  13.   EXIT : A = Time method, Zero Flag Clear (NZ) if Clock found
  14.          A = 0, Zero Flag Set (Z) if no clock found
  15.   USES : AF
  16.  
  17.  Usage: This routine calls GETDOS setting DOSVER and DOSTYP,
  18.   then looks for a clock to read, implying a File Stamp method.
  19.   Types are: "S"=ZSDOS/ZDDOS Internal, "D"=DateStamper,
  20.   "3"=CP/M Plus (CP/M 3.x, also termed P2DOS type).
  21.  
  22. GETDOS - Determine DOS type & Version, set global variables.
  23.  
  24.    DOSTYP - Byte variable for DOS type ("S"=ZSDOS, "D"=ZDDOS,
  25.         "1"=CP/M 1.x, "2"=CP/M 2.x, "3"=CP/M Plus (3.x),
  26.         "R"=ZRDOS, 0=Unknown)
  27.    DOSVER - Byte variable for DOS version # (vendor specific)
  28.  
  29.   ENTER: None
  30.   EXIT : A = DOS Type Character, Zero Clear (NZ) if identified
  31.          A = 0, Zero Flag Set (Z) if Not identified
  32.   USES : AF
  33.  
  34.  Usage: This routine is used to identify the running DOS type
  35.   and version.  It is called from TIMINI, but may be called
  36.   separately.  After it is called, DOSTYP and DOSVER globals
  37.   may be directly accessed.
  38.  
  39. FINDCK - Check for DateStamper(tm) clock and set read status
  40.  
  41.   ENTER: None
  42.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Clock Found
  43.      HL = pointer to Clock starting address if Found
  44.            A = 0, Zero Flag Set (Z), HL = - if Not Found
  45.   USES : AF,BC,DE,HL
  46.  
  47.  Usage: Used with DateStamper(tm)-specific interfaces.  Call
  48.   this routine near the beginning of a program to determine
  49.   clock status.  This routine is not needed if the recommended
  50.   TIMINI/RCLOCK generalized routines are used.
  51.  
  52. CKTDF - Check for DateStamper(tm) Time&Date File on drive
  53.  
  54.   ENTER: None
  55.   EXIT : A <> 0, Zero Flag Reset (NZ) if T&D file located Ok
  56.          A = 0, Zero Flag Set (Z) if NO T&D file present
  57.   USES : AF,BC,DE,HL
  58.   REQUIREMENTS: User must log desired drive before calling
  59.  
  60.  Usage: This routine is used with DateStamper(tm)-specific File
  61.   Stamp routines only, or with routines where individual file
  62.   stamp access is too slow.  It should be called before any
  63.   attempt is made to access File Stamp information.  A common
  64.   use is to set flags for mode changing between Stamp and Non-
  65.   Stamp operations.
  66.  
  67. :RCLOCK - Read clock identified by TIMINI to specified addr
  68.  
  69.   ENTER: HL = Address of 6-byte area to receive time string
  70.   EXIT :  A = 0, Zero Flag Set (Z) if Ok, Time String filled
  71.           A <> 0, Zero Flag Clear (NZ) if Error
  72.   USES : HL,DE,BC,AF
  73.  
  74.  Usage: This routine forms a generalized Clock Read for ZSDOS,
  75.   DateStamper or CP/M Plus clocks identified by TIMINI.  It
  76.   reads clock data to the specified address in the standard
  77.   format.  Since CP/M Plus does not return a valid read flag,
  78.   the status is always assumed to be True, for a good read.
  79.   Note: You must insure that a valid clock is installed and
  80.   working before calling this routine.
  81.  
  82. Example:
  83.     EXT    TIMINI,RCLOCK    ; Always declare both routines
  84.     ...            ; ..preliminary code
  85.     CALL    TIMINI        ; Initialize and identify clock
  86.     ...            ; ..other program code
  87.     LD    HL,TIMSTR    ; Place the time here
  88.     CALL    RCLOCK        ; ..and read the clock
  89.     JR    NZ,BADCLK    ; Jump if error reading clock
  90.     ...            ; ..else proceed to use it
  91.  TIMSTR: DEFS    6        ; Date/Time: YY MM DD HH MM SS
  92.  
  93. RDCLK - Read DateStamper(tm) clock to specified buffer
  94.  
  95.   ENTER: HL = Pointer to 6-byte buffer location
  96.   EXIT : HL = Pointer to last byte of Date/Time string if Ok
  97.       A <> 0, Zero Flag Clear (NZ) if Ok
  98.           A = 0, Zero Set (Z), HL = 0 if Bad Clock Read
  99.   USES : AF,BC,DE,HL
  100.   REQUIREMENTS:  FINDCK must have been previously called.
  101.  
  102.  Usage: This routine is used to read a DateStamper(tm)-specific
  103.   clock.  Date and Time information is returned in the same
  104.   format as other routines in this library.
  105.  
  106. Example:
  107.     EXT    RDCLK,FINDCK    ; Declare the routine
  108.     ...            ; ..initial program code
  109.     CALL    FINDCK        ; Call this early in program
  110.     ...            ; ..intervening program code
  111.     LD    HL,TIMSTR    ; Set addr for 6-byte buffer
  112.     CALL    RDCLK        ; Read the clock.
  113.     JR    Z,NOGOOD    ; ..jump if bad read
  114. :                   File Stamp Routines 
  115.  
  116. GSTAMP - Return File Date Stamp data for specified file
  117. PSTAMP - Set File Date Stamp data for specified file
  118.  
  119.   ENTER: DE = Pointer to FCB for file of interest
  120.      HL = Pointer to 15-byte buffer for/with Stamp data
  121.   EXIT :  A <> 0 Zero Flag Clear (NZ) if Operation Successful
  122.           A = 0, Zero Flag Set (Z) on Error
  123.   USES : AF,BC,HL
  124.   SIDE EFFECTS: Current DMA address will be altered if
  125.     DateStamper(tm) is used.
  126.   REQUIREMENTS: TIMINI must have been called to set global
  127.     variables.  Drive and User area for the specified file
  128.     must be set prior to calling either of these routines.
  129.  
  130.  Usage: These routines are recommended for File Stamp access in
  131.   CP/M-compatible systems.  They use the DOSTYP and TIMTYP
  132.   variables to determine stamp method in effect, and will read
  133.   and write File Stamps under ZSDOS and DateStamper with CP/M
  134.   2.2 or ZRDOS, and will read stamps from CP/M Plus (CP/M 3.x).
  135. Example:
  136.     EXT    GSTAMP,PSTAMP,TIMINI    ; Declare routines
  137.     ...            ; ..preceding code
  138.     CALL    TIMINI        ; Set the Time sybsystem early
  139.     ...            ; ..other program code
  140.     CALL    SETFCB        ; Set an FCB to a desired file
  141.     LD    DE,FCB        ; .point to it
  142.     LD    HL,TBUFF    ; ..and to buffer for Stamps
  143.     CALL    GSTAMP        ; Get stamp for this file
  144.     JR    Z,NOSTAMP    ; ..go to error handler if bad
  145.     ...            ; Use the data
  146.     CALL    SETDAT        ; Set stamp data in buffer
  147.     LD    DE,FCB        ; .point to FCB for file
  148.     LD    HL,TBUFF    ; ..and to buffer with Stamps
  149.     CALL    PSTAMP        ; Stamp file with TBUFF values
  150.     JR    Z,NOSTAMP    ; ..jump Error if bad return
  151.     ...            ; Else carry on.
  152.  
  153.  FCB:    DEFS    36        ; FCB for file of interest
  154.  TBUFF:    DEFS    15        ; Buffer for Stamp data
  155. GETTD - Get DateStamper(tm) File Stamp for specified file
  156.  
  157.   ENTER:  A - Contains T&D Sector Index (0..7) (from FSTNXT)
  158.      DE - Contains Random Record Number    (from FSTNXT)
  159.      HL = Pointer to 15-byte buffer for Date/Time info
  160.   EXIT :  A <> 0, Zero Flag Clear (NZ) if OK
  161.           A = 0, Zero Set (Z) if No File or Read Error
  162.   USES : AF,BC,DE,HL
  163.   REQUIREMENTS: User must log onto drive containg File & Stamp
  164.   SIDE EFFECTS: DMA is altered by this routine
  165.  
  166.  Usage: This is a DateStamper(tm)-specific routine returning
  167.   file stamp data for a file using FSTNXT call parameters.
  168.  
  169. Example:
  170.     EXT    GETTD        ; Declare the routine
  171.     ...            ; .check DateStamper
  172.     ...            ; ..Log drive, Call FSTNXT
  173.     LD    HL,USRDAT    ; Put 15-byte Stamp data here
  174.     CALL    GETTD        ; Fill in destination string
  175.     JR    Z,NODATA    ; ..jump if bad/no stamp
  176.     ...            ; Else process the stamp
  177. SETTD - Set DateStamper File Stamp into for specified file.
  178.  
  179.   ENTER:  A - Contains T&D Sector Index (0..7) (from FSTNXT)
  180.      DE - Contains Random Record Number    (from FSTNXT)
  181.      HL = Pointer to Stamp data in 15-byte buffer
  182.   EXIT :  A <> 0, Zero Flag Clear (NZ) if OK
  183.           A = 0, Zero Set (Z) if No File or Read Error
  184.   USES : AF,BC,DE,HL
  185.   REQUIREMENTS: You must log onto drive containing file & Stamp
  186.   SIDE EFFECTS: DMA is altered by this routine
  187.  
  188.  Usage: This DateStamper(tm)-specific routine sets File Stamp
  189.   data for a specified file to user-supplied values.
  190.  
  191. Example:
  192.     EXT    SETTD        ; Declare the routine
  193.     ...            ; .Validate DateStamper
  194.     ...            ; ..log drive, call FSTNXT
  195.     LD    HL,USRDAT    ; Point to 15-byte Stamp field
  196.     CALL    SETTD        ; Set DateStamper File Stamp
  197.     JR    Z,BADSET    ; ..jump if if Error
  198.     ...            ; Else carry on!
  199. :DDIRQS - Return sorted directory with file stamps and sizing
  200.  DDIRQ  - Return sorted directory with file stamps
  201.  
  202.   ENTER: HL = Address of TPA buffer start
  203.      DE = Points to FCB entry to match directory entries
  204.       A = Select character
  205.         B7 - 1 = Select SYStem files
  206.         B6 - 1 = Select Non-SYStem files
  207.         B5 - 1 = Select All users
  208.       C = Secondary select
  209.         B7 - 1=Sort Type then Name, 0=Name then Type
  210.         B0 - 1=Search DateStamper first, then DosDisk
  211.             then P2DOS stamps; 0=Skip DateStamper
  212.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Ok,
  213.           A = 0, Zero Set (Z) if TPA Overflow
  214.      BC = Number of files in Sorted Directory Array
  215.      HL = Address of first file in buffer
  216.   USES : HL,BC,AF
  217.   SIDE EFFECT: Dos DMA Address is set to 80H
  218.  
  219.  Usage: These routines provide a replacement for the SYSLIB
  220.   routines DIRQS and DIRQ.  File Stamps are automatically
  221.   appended to Directory data from DateStamper(tm), P2DOS (CP/M
  222.   Plus), and Plu*Perfect Systems' DosDisk.  The Last Access
  223.   field is nulled in P2DOS, and the single DosDisk stamp is
  224.   returned in the Last Modified field.  Each entry is 31 char-
  225.   acters long (16 for file entry, 15 for stamp).
  226.  
  227. Example:
  228.     EXT    DDIRQS        ; ..or DDIRQ.  DON'T use both
  229.     ...
  230.     CALL    CODEND        ; Get lower TPA value in HL
  231.     LD    DE,MYFCB    ; Match this file spec
  232.     LD    C,01H        ; Sort Name/Type, DS first
  233.     LD    A,0E0H        ; SYS & Non-SYS, all user areas
  234.     CALL    DDIRQS        ; Do the call (or to DDIRQ)
  235.     JP    Z,ERROR        ; ..error if not enough space
  236.     LD    A,B        ; Do we have any files?
  237.     OR    C        ; ..BC has number of files
  238.     JP    Z,NOFILS    ; Jump if no files in array
  239.     ...            ; ..use the files in the array
  240.  
  241.  MYFCB:    DEFB    0,'???????????',0,0,0,0        ; FCB to match
  242.     DEFB    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  243.  
  244. DDIRNPAK - Negate selection markings in Directory Buffer
  245.  
  246.   ENTER: HL = Points to Directory Buffer from DDIRQ/DDIRQS
  247.      BC = Number of entries in the Buffer
  248.   EXIT : BC = Number of entries in Buffer after select/packing
  249.   USES : BC
  250.  
  251.  Usage: This routine is used to delete file entries from DDIRQS
  252.   or DDIRQ directory routines.  Upon completion, only entries
  253.   previously unmarked remain, and the table is compressed to
  254.   only these entries. This is similar to the SYSLIB routine
  255.   DIRNPAK, but tailored to Time/Date Stamped Directory lists.
  256.  
  257. Example:
  258.     EXT    DDIRNPAK    ; Declare the routine
  259.     ...            ; Build dir table (DDIRQ(S))
  260.     ...            ; ..and select entries
  261.     LD    HL,(BUFF)    ; Buffer start (DDIRQ/DDIRQS)
  262.     LD    BC,(COUNT)    ; ..# of entries (DDIRQ/DDIRQS)
  263.     CALL    DDIRNPAK    ; Keep unselected & pack Buffer
  264.     ...            ; ..continue w/ new file count
  265.  
  266. DDIRPAK - Pack Directory Buffer from DDIRQ/DDIRQS
  267.  
  268.   ENTER: HL = Points to Directory Buffer from DDIRQ/DDIRQS
  269.      BC = Number of entries in the Buffer
  270.   EXIT : BC = New Number of Buffer entries after select/pack
  271.   USES : BC
  272.  
  273.  Usage: Compress File ID array from Directory Sort routine
  274.   retaining only marked file entries.  This routine is similar
  275.   to the SYSLIB routine DIRPAK, but functions with Time/Date
  276.   Stamped Directory lists.
  277.  
  278. Example:
  279.     EXT    DDIRPAK        ; Declare the routine
  280.     ...            ; build dir tbl (DDIRQ/DDIRQS)
  281.     ...            ; ..and select entries
  282.     LD    HL,(BUFF)    ; Buffer start (DDIRQ/DDIRQS)
  283.     LD    BC,(COUNT)    ; ..# of entries (DDIRQ/DDIRQS)
  284.     CALL    DDIRPAK        ; Keep selected entries & pack
  285.     ...            ; ..continue w/new file count
  286.  
  287. DDIRSEL - Select entries from DDIRQ/DDIRQS Directory Buffer
  288.  
  289.   ENTER: HL = Points to Directory Buffer from DDIRQ/DDIRQS
  290.      DE = FCB entry to select against
  291.      BC = Number of entries in the Buffer
  292.       A = Select flag: Bit 7 - Select Non-SYStem files
  293.                Bit 6 - Select SYStem files
  294.                Bit 5 - Select All Users
  295.                Bits 4..0 - User Number
  296.   EXIT : None.  Selected files are marked
  297.   USES : None
  298.  
  299.  Usage: Select file entries by setting the MSB of the first
  300.   byte (User #) based on file name and type in FCB, and
  301.   selection flags.  This routine is similar to the SYSLIB
  302.   routine DIRSEL, but accomodates Time/Date Stamped Directory
  303.   lists.
  304.  
  305. Example:
  306.     EXT    DDIRSEL        ; Declare the routine
  307.     ...            ; Build Dir (DDIRQ/DDIRQS)
  308.     LD    HL,(BUFF)    ; Buffer start (DDIRQ/DDIRQS)
  309.     LD    DE,MYFCB    ; .FCB criteria for selection
  310.     LD    BC,(COUNT)    ; ..and # entries (from DDIRQ)
  311.     LD    A,01100000B    ; SYS files in All User Areas
  312.     CALL    DDIRSEL        ; Mark matching entries
  313.     ...            ; ..continue on
  314. :U2PTIM - Convert ZSDOS/DateStamper Time to P2DOS (CP/M Plus)
  315.  
  316.   ENTER: DE = Points to Universal Time string (Source)
  317.      HL = Points to P2DOS Time string (Destination)
  318.   EXIT :  A = 0, Zero Set (Z) if Ok, Dest time set (less secs)
  319.           A <> 0, Zero Clear (NZ) if error, Dest zeroed
  320.      DE = Pointer to Secs byte in Source string (not moved)
  321.      HL = Pointer to Secs byte in Dest string (not filled)
  322.   USES : HL,DE,BC,AF
  323.  
  324.  Usage: Utility conversion of Time from ZSDOS/DateStamper(tm)
  325.   to CP/M Plus type.  Only the Date, Hour and Minute fields are
  326.   converted, but registers are returned such that a single LDI
  327.   move instruction after the routine will move any seconds
  328.   information.  Years 78-99 are assumed to be 1978-1999, 0-77
  329.   as 2000-2077.  This routine would commonly be used in
  330.   programs such as Library Utilities which internally use a
  331.   CP/M Plus type of stamp.
  332.  
  333. Example:
  334.     EXT    U2PTIM        ; Declare the variable
  335.     ...            ; Read a clock or stamp
  336.     LD    DE,UTIM        ; Set source time spec address
  337.     LD    HL,PTIM        ; ..and dest time spec addr
  338.     CALL    U2PTIM        ; Do the conversion
  339.     JR    NZ,ERROR    ; ..jump if conversion error
  340.     ...            ; Else use the P2DOS string
  341.  
  342. P2UTIM - Convert P2DOS (CP/M Plus) Time spec to Standard
  343.  
  344.   ENTER: HL = Points to P2DOS (CP/M Plus) Time string (Source)
  345.      DE = Points to Universal Time string (Destination)
  346.   EXIT :  A = 0, Zero Set (Z), Dest string filled (less secs)
  347.           Errors only due to bad entry.  (Check YY=MM=0)
  348.      HL = Points to Secs byte in Source string (Not moved)
  349.      DE = Points to Secs byte in Dest string (not filled)
  350.   USES : HL,DE,BC,AF
  351.  
  352.  Usage: Commonly used to provide interface from CP/M Plus
  353.   systems to CP/M 2.2, or in Library Utility routines to
  354.   provide time interface.  Source stamp is P2DOS (CP/M Plus
  355.   compatible), destination is ZSDOS/DateStamper(tm) standard.
  356.   A single LDI move instruction after conversion will move the
  357.   seconds byte.  Only dates from 1 Jan 1978 thru 31 Dec 2077
  358.   will be properly converted.  Other dates will set Year and
  359.   Month bytes to zero.  Check this state for error condition.
  360.  
  361. Example:
  362.     EXT    P2UTIM        ; Declare the variable
  363.     ...            ; Read a clock or Stamp
  364.     LD    DE,UTIM        ; Point to the Dest string
  365.     LD    HL,PTIM        ; ..and the Source string
  366.     CALL    P2UTIM        ; Do the conversion
  367.     LDI            ; Move the seconds (if desired)
  368.     LD    HL,UTIM        ; Check for errors
  369.     LD    A,(HL)        ; Get years byte
  370.     INC    HL        ; ..advance to Months
  371.     OR    L        ; ...and check for errors
  372.     JR    Z,ERROR        ; Jump if error
  373.     ...            ; ..continue on
  374. U2MTIM - Convert Universal Time Spec to MS-DOS/DosDisk(tm)
  375.  
  376.   ENTER: DE = Points to Universal Time string (Source)
  377.      HL = Points to MS-DOS format Time string (Destination)
  378.   EXIT :  A = 0, Zero Set (Z) if Ok, Dest time set (less secs)
  379.           A <> 0, Zero Clear (NZ) if error, Dest str zeroed
  380.      DE = Pointer to Secs byte in Source string (not moved)
  381.      HL = Pointer to High-order time byte in MS-DOS field
  382.             (low-order byte has secs field nulled)
  383.   USES : HL,DE,BC,AF
  384.  
  385.  Usage: Commonly used to convert from internal time format to
  386.   External form for writing to MS-DOS disk formats.  Conversion
  387.   of seconds data to the format used in the MS-DOS Time spec is
  388.   a user program responsibility.  Dates from 1 January 1980 to
  389.   31 December 2077 will be properly converted.
  390.  
  391. Example:
  392.     EXT    U2MTIM        ; Declare the variable
  393.     ...            ; Read a clock or stamp
  394.     LD    DE,UTIM        ; Source time spec string addr
  395.     LD    HL,MTIM        ; ..dest time spec string addr
  396.     CALL    U2MTIM        ; Do the conversion
  397.     JR    NZ,ERROR    ; ..jump if conversion error
  398.     ...            ; Else use P2DOS string
  399. M2UTIM - Convert MS-DOS/DosDisk(tm) Time to Universal
  400.  
  401.   ENTER: HL = Points to MS-DOS Time string (Source)
  402.      DE = Points to Universal Time string (Destination)
  403.   EXIT :  A = 0, Zero Set (Z), Dest string filled (less secs)
  404.           A <> 0, Zero Clear (NZ) if Error, Dest Nulled
  405.      HL = Points to Second (hi-order) byte in MS-DOS string
  406.      DE = Points to Secs byte in Dest string (not filled)
  407.   USES : HL,DE,BC,AF
  408.  
  409.  Usage: Commonly used to convert MS-DOS time to internal format
  410.   for internal program manipulation.  Conversion of seconds is
  411.   your responsibility.  Dates from 1 Jan 1980 thru 31 Dec 2077
  412.   will be properly converted.  Others produce null date.
  413.  
  414. Example:
  415.     EXT    M2UTIM        ; Declare the variable
  416.     ...            ; Read a clock or stamp
  417.     LD    DE,UTIM        ; Point to the Dest string
  418.     LD    HL,MTIM        ; ..and the Source string
  419.     CALL    M2UTIM        ; Do the conversion
  420.     JR    NZ,ERROR    ; ..handle error if bad
  421.     ...            ; Else convert secs & continue
  422.  
  423. :FSTNXT - File search returning DateStamper(tm) Indices
  424.  
  425.   ENTER:  C - Search First (17) or Search Next (18) DOS command
  426.      DE - Points to FCB containg the target Filename.type
  427.   EXIT :  A = Dir Index (0..3), Carry Flag Clear (NC) If Found
  428.           A indeterminate, Carry Flag Set (C) If NOT Found
  429.      DE - Contains random Sector number in !!!TIME&.DAT
  430.       B - Index into T&D sector (0..7)
  431.   USES : AF,BC,DE,HL
  432.   REQUIREMENTS: User must log Drive and User before calling
  433.  
  434.  Usage: This routine is used in DateStamper-specific systems to
  435.   perform File searches and return indices into the Time & Date
  436.   file.  Use this call for Function 17 and 18 Search calls in
  437.   lieu of a direct call to the BDOS vector at location 5.
  438.  
  439. Example:
  440.     EXT    FSTNXT        ; Declare the routine
  441.     ...            ; Log Drive/User & Set FCB
  442.     LD    C,17        ; Set for Search First command
  443.     LD    DE,FCB        ; ..addr FCB for desired name
  444.     CALL    FSTNXT        ; Search for the desired file
  445.     JR    NC,FOUND    ; ..jump if file found
  446.     ...            ; Else do not found things
  447.  
  448. BCD2BIN - Convert Binary Coded Decimal (BCD) byte to binary
  449.  
  450.   ENTER: A = BCD digit to convert (0-99 value)
  451.   EXIT : A = binary byte representation of digit(s) (00-63H)
  452.   USES : AF
  453.  
  454.  Usage: This routine is primarily used in conversions of dates
  455.   used by DSLIB routines but is available for other uses.  It
  456.   converts a packed BCD byte in the range of 0 to 99 to a
  457.   binary byte of 0..63H.
  458.  
  459. BIN2BCD - Convert binary byte to packed BCD.
  460.  
  461.   ENTER: A = Binary digit to convert (00-63H, 0-99 decimal)
  462.   EXIT : A = Packed BCD byte (1 or 2 digits)
  463.   USES : AF
  464.  
  465.  Usage: This routine is commonly used to convert bytes in the
  466.   range of 0-99 (00-63H) to a packed BCD byte.  It is primarily
  467.   used in date conversion routines in DSLIB but is available
  468.   for other uses.
  469.  
  470. DVERS - Return the DSLIB version number
  471.  
  472.   ENTER: None
  473.   EXIT : HL - Contains the Version Number (H=major, L=minor)
  474.   USES : HL.  Other registers unaffected
  475.  
  476.  Usage: This routine is most often used for control or
  477.   debugging purposes to embed the linked library version.
  478.  
  479. :OPENTD - Open DateStamper(tm) Time & Date file for Read/Write
  480.  
  481.   ENTER: A = 0 for Read, A = 0FFH for Write
  482.   EXIT : A <> 0, Zero Flag Clear (NZ) if OK
  483.          A = 0, Zero Flag Set (Z) if Open Error
  484.   USES : AF,BC,DE,HL
  485.   REQUIREMENTS: You must select the drive before calling
  486.  
  487.  Usage: This DateStamper-specific routine is used to access
  488.   large numbers of stamps, or where performance penalties in
  489.   per-file stamp accesses are undesireable.  This routine Opens
  490.   the TIME&DAT file in User 0 on the current drive.  If opened
  491.   for writing, the R/O attribute is cleared.  The User Number
  492.   is restored on exit.
  493.  
  494. CLOSTD - Close DateStamper(tm) Time & Date file
  495.  
  496.   ENTER: None
  497.   EXIT : A <> 0, Zero Flag Clear (NZ) if OK
  498.          A = 0, Zero flag Set (Z) if Error
  499.   USES : AF,BC,DE,HL
  500.  
  501.  Usage: This DateStamper-specific routine closes the TIME&DAT
  502.   file in user 0 of current drive, and sets the R/O bit.  It is
  503.   used in conjunction with OPENTD above.
  504.  
  505. RWTD - Read or write to Time & Date file on current drive.
  506.  
  507.   ENTER:  A = 0 to Read, A = 0FFH to Write
  508.      DE - Contains Random Record to Read or Write
  509.   EXIT : HL - Addresses the start of T&D sector Read/Written
  510.       A <> 0, Zero Flag Clear (NZ) if OK
  511.           A = 0, Zero Flag Set (Z) if Error
  512.   USES : AF,BC,DE,HL and BDOS DMA Address
  513.  
  514.  Usage: DateStamper(tm)-specific routine normally used only for
  515.   Directory list, Catalog or Archive programs where access to
  516.   blocks of Date Stamps is desired.
  517.   NOTE: You must reset DMA address after call if needed.
  518.  
  519. Example:
  520.     EXT    RWTD        ; Declare the routine
  521.     ...            ; Log drive, Set DMA addr
  522.     LD    DE,(RECNUM)    ; Get T&D Rec # from FSTNXT or
  523.                 ; ..specified Random rec number
  524.     LD    A,MODE        ; A=0 for read, A=FF for write
  525.     CALL    RWTD        ; Perform the action
  526.     JR    NZ,RWOK        ; ..jump if OK
  527.     ...            ; Else perform error activity
  528.  RWOK:    ...            ; Sector has been read/written
  529.