?login_element?

Subversion Repositories NedoOS

Rev

Rev 1871 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;clock driver nedoOS
  2.         module Clock
  3. readTime
  4.         ld c,nos.CMD_GETTIME
  5.     call nos.BDOS               ;out: ix=date, hl=time
  6.         di
  7.         push ix
  8.         pop bc
  9.         ei
  10.  
  11.         push hl
  12.         pop de
  13.         ld a,e
  14.     add a,a
  15.     and 63      ;seconds
  16.         ld (seconds),a
  17.        
  18.         ld a,d
  19.     rra
  20.     rra
  21.     rra
  22.     and 31              ;hours
  23.         ld (hours),a
  24.  
  25.     ex de,hl
  26.     add hl,hl
  27.     add hl,hl
  28.     add hl,hl
  29.     ex de,hl
  30.     ld a,d
  31.     and 63       ;minutes
  32.         ld (minutes),a
  33.  
  34. ;   ld a,h
  35. ;   srl a
  36. ;   ;sub 20
  37. ;   ld (year),a
  38. ;   ld a,l
  39. ;   and 31
  40. ;   ld (day),a
  41. ;   add hl,hl
  42. ;   add hl,hl
  43. ;   add hl,hl
  44. ;   ld a,h
  45. ;   and 15
  46. ;   ld (month),a
  47.  
  48.  
  49.         ret
  50.     endmodule
  51.