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 / BYE5 / B5C-DS.LBR / B5C-DS.IZS / B5C-DS.INS
Text File  |  2000-06-30  |  2KB  |  73 lines

  1. ; B5C-DS.INS    BYE5 Clock Insert for any 8080- or Z80-compatible
  2. ;         computer with DateStamper running "high" (CCP not
  3. ;        protected).  Requires that the DS clock driver
  4. ;        entry address be pointed to by a vector at 0008H
  5. ;        or another available and safe RST call address.
  6. ;        The vector is set up by a utility like DSSET or
  7. ;        DSTOBYE, or by simply poking a C3h at 0008h and
  8. ;        the DS clock driver entry address at 0009h (LSB
  9. ;        first, of course).  The clock address is usually
  10. ;        displayed when DS itself loads, recent versions
  11. ;        (1.2 or later) of the ZCPR3 utility Z3LOC.COM
  12. ;        also display this information.
  13. ;
  14. ;        Written by Bruce Morgen, May 11, 1988 @14:39:59
  15.  
  16.  
  17. ; This insert (which is NOT an overlay) uses BYE5xx's "BCDBIN"
  18. ; code, so set the BYE5xx equate "BCD2BIN" to "YES".
  19.  
  20. ;
  21. ; BYE5 saves and restores registers before/after calling TIME.
  22. ;
  23. VECADD    EQU    0008H        ; Choose an RST vector, normally
  24.                 ; 0008h is available and safe.
  25. TIME:
  26.     LXI    H,DSBFR
  27.     RST    VECADD/8    ; Fill temp. buffer from DS,
  28. ;A jmp to the DS clock driver is initialized before BYE is run
  29.     LXI    D,RTCBUF+2    ; Point BYE seconds
  30.     MOV    A,M        ; DS seconds in A
  31.     STAX    D        ; To BYE
  32.     DCX    H        ; Decrement pointers
  33.     DCX    D
  34.     MOV    A,M        ; DS minutes in A
  35.     STAX    D        ; To BYE
  36.     CALL    BCDBIN        ; Convert to binary
  37.     STA    CCMIN        ; for BYE
  38.     DCX    H        ; Decrement pointers
  39.     DCX    D
  40.     MOV    A,M        ; DS hours in A
  41.     STAX    D        ; To BYE
  42.     CALL    BCDBIN        ; Convert to binary
  43.     STA    CCHOUR        ; for BYE
  44.     DCX    H        ; Point DS day
  45.     LXI    D,RTCBUF+6    ; and BYE day
  46.     MVI    B,3        ; Move 3 bytes
  47. MCLKLP:
  48.     MOV    A,M        ; 8080-style move loop
  49.     STAX    D
  50.     DCX    H
  51.     DCX    D
  52.     DCR    B
  53.     JNZ    MCLKLP
  54.     XCHG            ; HL points to BYE century
  55.     MVI    M,19H        ; Poke in current century
  56.     RET            ; All done...
  57.  
  58. ; DateStamper's time buffer format (packed BCD):
  59. DSBFR:    DS    1        ; 00 - 99 (year)
  60.     DS    1        ;  1 - 12 (month)
  61.     DS    1        ;  1 - 31 (day)
  62.     DS    1        ; 00 - 23 (hour)
  63.     DS    1        ; 00 - 59 (minute)
  64.     DS    1        ; 00 - 59 (second)
  65.  
  66. ;**********************************************************************
  67. ;
  68. ; This is the end of the TIME insert for BYE500 and up.
  69. ; Replace the existing BYE5 TIME code with this insert.
  70. ; It SHOULD work fine...
  71. ;
  72. ;**********************************************************************
  73.