home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / bye3 / b3c-bbii.ins < prev    next >
Text File  |  1994-07-13  |  2KB  |  71 lines

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