Subversion Repositories Kolibri OS

Rev

Rev 5363 | Rev 9715 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5363 Rev 9612
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 5363 $
8
$Revision: 9612 $
9
 
9
 
10
 
10
 
Line 199... Line 199...
199
        inc     dx
199
        inc     dx
200
        in      al, dx
200
        in      al, dx
201
        btc     ax, 7
201
        btc     ax, 7
202
        out     dx, al
202
        out     dx, al
203
        ret
203
        ret
-
 
204
 
-
 
205
align 4
-
 
206
sys_clock:
-
 
207
        cli
-
 
208
  ; Mikhail Lisovin  xx Jan 2005
-
 
209
  @@:
-
 
210
        mov     al, 10
-
 
211
        out     0x70, al
-
 
212
        in      al, 0x71
-
 
213
        test    al, al
-
 
214
        jns     @f
-
 
215
        mov     esi, 1
-
 
216
        call    delay_ms
-
 
217
        jmp     @b
-
 
218
  @@:
-
 
219
  ; end Lisovin's fix
-
 
220
 
-
 
221
        xor     al, al        ; seconds
-
 
222
        out     0x70, al
-
 
223
        in      al, 0x71
-
 
224
        movzx   ecx, al
-
 
225
        mov     al, 02        ; minutes
-
 
226
        shl     ecx, 16
-
 
227
        out     0x70, al
-
 
228
        in      al, 0x71
-
 
229
        movzx   edx, al
-
 
230
        mov     al, 04        ; hours
-
 
231
        shl     edx, 8
-
 
232
        out     0x70, al
-
 
233
        in      al, 0x71
-
 
234
        add     ecx, edx
-
 
235
        movzx   edx, al
-
 
236
        add     ecx, edx
-
 
237
        sti
-
 
238
        mov     [esp + 32], ecx
-
 
239
        ret
-
 
240
 
-
 
241
 
-
 
242
align 4
-
 
243
 
-
 
244
sys_date:
-
 
245
 
-
 
246
        cli
-
 
247
  @@:
-
 
248
        mov     al, 10
-
 
249
        out     0x70, al
-
 
250
        in      al, 0x71
-
 
251
        test    al, al
-
 
252
        jns     @f
-
 
253
        mov     esi, 1
-
 
254
        call    delay_ms
-
 
255
        jmp     @b
-
 
256
  @@:
-
 
257
 
-
 
258
        mov     ch, 0
-
 
259
        mov     al, 7           ; date
-
 
260
        out     0x70, al
-
 
261
        in      al, 0x71
-
 
262
        mov     cl, al
-
 
263
        mov     al, 8           ; month
-
 
264
        shl     ecx, 16
-
 
265
        out     0x70, al
-
 
266
        in      al, 0x71
-
 
267
        mov     ch, al
-
 
268
        mov     al, 9           ; year
-
 
269
        out     0x70, al
-
 
270
        in      al, 0x71
-
 
271
        mov     cl, al
-
 
272
        sti
-
 
273
        mov     [esp+32], ecx
-
 
274
        ret