home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn2ah.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.7 KB  |  35 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;            Function 2AH: Get Date                          ;
  4.         ;                                                            ;
  5.         ;            long get_date(pdow,pmonth,pday,pyear)           ;
  6.         ;                 char *pdow,*pmonth,*pday;                  ;
  7.         ;                 int *pyear;                                ;
  8.         ;                                                            ;
  9.         ;            Returns the date packed into a long:            ;
  10.         ;                 low byte  = day of month                   ;
  11.         ;                 next byte = month                          ;
  12.         ;                 next word = year.                          ;
  13.         ;                                                            ;
  14.         ;************************************************************;
  15.  
  16. cProc   get_date,PUBLIC,ds
  17. parmDP  pdow
  18. parmDP  pmonth
  19. parmDP  pday
  20. parmDP  pyear
  21. cBegin
  22.         mov     ah,2ah          ; Set function code.
  23.         int     21h             ; Get date info from MS-DOS.
  24.         loadDP  ds,bx,pdow      ; DS:BX = pointer to dow.
  25.         mov     [bx],al         ; Return dow.
  26.         loadDP  ds,bx,pmonth    ; DS:BX = pointer to month.
  27.         mov     [bx],dh         ; Return month.
  28.         loadDP  ds,bx,pday      ; DS:BX = pointer to day.
  29.         mov     [bx],dl         ; Return day.
  30.         loadDP  ds,bx,pyear     ; DS:BX = pointer to year.
  31.         mov     [bx],cx         ; Return year.
  32.         mov     ax,dx           ; Pack day, month, ...
  33.         mov     dx,cx           ; ... and year into return value.
  34. cEnd
  35.