home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z80dos / z80dmod.lbr / Z80DMOD.ZZ0 / Z80DMOD.Z80
Encoding:
Text File  |  1993-06-08  |  1.1 KB  |  48 lines

  1. ; Z80DOS - Z80 Disk Operating System
  2. ;
  3. ; Version 1.0 - 05 Sept. 87 by Carson Wilson
  4. ;
  5. ;
  6. ; Support file:    Z80DMOD.Z80
  7. ; Version:    1.0
  8. ; Author:    Fred Haines, adapted from the routine by Carson Wilson
  9. ;
  10. ; Description:    eliminates necessity for BIOS insert to implement 
  11. ;               Z80DOS time routine without a realtime clock.
  12.  
  13. ; Example time routine for systems without realtime clock:
  14. ;
  15. ; Inputs: C <> 0: 5-byte entry pointed to by HL sets system time
  16. ;          HL points to 5-byte time buffer of the form:
  17. ;
  18. ;        HL + 0 = low  byte days since December 31, 1977 in hex
  19. ;        HL + 1 = high byte  "      "      "    "     "     "  "
  20. ;        HL + 2 = BCD hours
  21. ;        HL + 3 = BCD minutes
  22. ;        HL + 4 = BCD seconds
  23. ;
  24. ;      C = 0: On return HL points to 5-byte time entry
  25.  
  26. ;
  27. ; Begin routine
  28.  
  29. timebuf    equ    0050h    ; Address of time storage at page zero
  30.             ; or other available protected RAM area
  31.  
  32.     org    bios-17
  33.  
  34. time1:
  35.     ld    a,c        ; Test flag
  36.     or    a
  37.     jr    nz,setime    ; C <> 0, set time
  38.     ld    hl,timebuf    ; Point HL to buffer
  39.     ret
  40. setime:
  41.     ld    de,timebuf    ; Point to storage
  42.     ld    bc,5        ; Copy five bytes
  43.     ldir
  44.     ret
  45.  
  46. ; END Z80DMOD.Z80
  47.  
  48.