1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
;
page 80,132
;
title CP/DOS DosGetDateTime mapper
;
dosxxx segment byte public 'dos'
assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
;
;**********************************************************************
;*
;* MODULE: dosgetdatetime
;*
;* FUNCTION: get date and time information
;*
;* CALLING SEQUENCE:
;*
;* push@ struc date/time
;* call dosgetdatetime
;*
;* MODULES CALLED: PC-DOS Int 21h, ah=2ah, get date
;* ah=2ch, get time
;*
;*********************************************************************
public dosgetdatetime
.sall
include macros.inc
str struc
old_bp dw ?
return dd ?
data dd ? ; date and time info return pointer
str ends
dosgetdatetime proc far
Enter dosgetdatetime ; push registers
lds si,[bp].data ; set return data area
mov ah,2ch ; get time information
int 21h
; save info in return data are
mov byte ptr [si],ch ; save hour
mov byte ptr [si]+1,cl ; minutes
mov byte ptr [si]+2,dh ; seconds
mov byte ptr [si]+3,dl ; hundredths
mov ah,2ah ; get date and save it
int 21h ; in return data area
mov byte ptr [si]+4,dl ; save day
mov byte ptr [si]+5,dh ; month
mov word ptr [si]+6,cx ; year
mov word ptr [si]+8,360 ; min. from GMT
mov byte ptr [si]+10,al ; day of week
exit: sub ax,ax ; set good return code
Mexit ; pop registers
ret size str - 6 ; return
dosgetdatetime endp
dosxxx ends
end
|