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-TV1.IQS / B5C-TV1.INS
Text File  |  2000-06-30  |  2KB  |  72 lines

  1. ;
  2. ;**********************************************************************
  3. ;
  4. ; B5C-TV1.INS    A 'TIME' insert for BYE5
  5. ;  03/24/86    Note: This is an insert--not an overlay
  6. ;            Ian Cottrell
  7. ;            ICBBS, 613-990-9774
  8. ; Adapted from:
  9. ; MBC-BBII.ASM -- Version 1 -- 10/31/84 -- by Mark A. Matthews
  10. ;
  11. ;
  12. ;    TIME routine for BYE5 running on Televideo 803H
  13. ;
  14. ;    This overlay is designed to work on a TeleVideo 803H running BYE5.
  15. ;    (Find your own clock set program...I wrote one called TIMSET
  16. ;     which you might find on some BBS's)
  17. ;
  18. ;    When called this routine will check the RTCBUF. If a '99H'
  19. ;    is in the first byte, the clock is initialized. Next the
  20. ;    seconds are checked, and if changed since last update of
  21. ;    RTC buffer, the clock is stopped, data copied to RTCBUF and
  22. ;    the clock is restarted. (If no change in seconds, the
  23. ;    routine returns immediately.)
  24. ;
  25. ;-----------------------------------------------------------------------
  26. ;
  27. ; Real-Time clock buffer - is organized as HH:MM:SS YYYY/MM/DD
  28. ;
  29. ;RTCBUF:DB    99H,99H,99H    ;HH:MM:SS (BCD 24HR TIME) 00:00:00-23:59:59
  30. ;    DB    19H,84H,01H,31H ;YYYY/MM/DD (BCD ISO DATE)
  31. ;
  32. ;
  33. ; BYE5 saves and restores registers before/after calling TIME.
  34. ;
  35. TVCLK    EQU    0F6E6H        ; Address of TeleVideo 803H's own clock
  36.                 ; Registers (in SS:MM:HH/DD-MM-YY format)
  37.                 ; Backwards from what we want.
  38. TIME:    LXI    H, TVCLK+1    ; HL points to TV 803H array - skip 1/100 secs
  39.     LDA    RTCBUF+2    ; Get old secs
  40.     XRA    M        ; Compared to current secs
  41.     ANI    0FH
  42.     JZ    CLKEXIT        ; If no change, skip update
  43.     MOV    A, M        ; Start with seconds
  44.     STA    RTCBUF+2    ; And copy to RTCBUF (secs)
  45.     INX    H        ; Now minutes
  46.     MOV    A, M
  47.     STA    RTCBUF+1    ; Copy into RTCBUF (mins)
  48.     INX    H        ; Now hours
  49.     MOV    A, M
  50.     STA    RTCBUF+0    ; Copy into RTCBUF (hours)
  51.     INX    H        ; Days
  52.     MOV    A, M
  53.     STA    RTCBUF+6    ; Copy into RTCBUF (days)
  54.     INX    H        ; Now do months
  55.     MOV    A, M
  56.     STA    RTCBUF+5    ; Copy into RTCBUF (months)
  57.     INX    H        ; And finally, years
  58.     MOV    A, M
  59.     STA    RTCBUF+4    ; Copy it into RTCBUF (years)
  60. ;
  61. CLKEXIT:LDA    RTCBUF        ; Pick up BCD HH
  62.     CALL    BCDBIN        ; Convert to binary
  63.     STA    CCHOUR        ; For BYE5
  64.     LDA    RTCBUF+1    ; Pick up BCD MM
  65.     CALL    BCDBIN        ; Convert to binary
  66.     STA    CCMIN        ; For BYE
  67.     RET            ; And return (for now..)
  68. ;.....
  69. ;
  70. ;                   end
  71. ;-----------------------------------------------------------------------
  72.