home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / modem / mxc-s180.z80 < prev    next >
Encoding:
Text File  |  1993-06-08  |  1.1 KB  |  52 lines

  1. ;Real-Time Clock overlay for SB180/MEX
  2. ;Jerry Glomph Black 14 March 1987
  3. ;Original release 1.0
  4.     org    0e00h
  5.     jp    gettim
  6.     jp    getdat
  7.     ret
  8.     nop
  9.     nop
  10.     ret
  11.     nop
  12.     nop
  13.     ret
  14.     nop
  15.     nop
  16. ;gettim returns B=hours,C=minutes,D=seconds,E=0 (hundredths)
  17. gettim:
  18.     ld    hl,(1)    ;bios warm boot vector
  19.     ld    bc,33h
  20.     add    hl,bc    ;clock routine in SB180 bios
  21.     ld    bc,noogie
  22.     push    bc    ;a pseudo-
  23.     jp    (hl)    ;subroutine call
  24. noogie:    ld    bc,4
  25.     add    hl,bc    ;hl now has addr of secs.
  26.     ld    d,(hl)
  27.     inc    hl
  28.     ld    c,(hl)
  29.     inc    hl
  30.     ld    b,(hl)
  31.     ld    e,0
  32.     ret        ;ok, the appropriate regs. are stuffed
  33. getdat:
  34. ;getdat puts year into BC, month into D, day into E
  35. ;A routine using Mex's POKE utility can set the date,
  36. ;since the SB180 doesn't keep it. Look for the 
  37. ;string 'GLOMPH' to find the date bytes.
  38.     ld    bc,(year)
  39.     ld    a,(month)
  40.     ld    d,a
  41.     ld    a,(day)
  42.     ld    e,a
  43.     ret        ;that does it.
  44. ;
  45. ;    Default date: Feb 31,2001
  46. ;
  47.     db    'GLOMPH'    ;the tag of distinction
  48. month:    db    2        ;month from 1-12
  49. day:    db    31        ;day from 1-31
  50. year:    dw    2001        ;year from 1985-2099
  51.     end
  52.