home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c017 / 36.ddi / DBTOC.ZIP / SYSDATE.ASM < prev    next >
Encoding:
Assembly Source File  |  1987-11-01  |  995 b   |  40 lines

  1. ;------------------------------------------------------------------
  2. ;  Function:  SYSDATE()
  3. ;
  4. ;   Description:   Returns the system date in packed format:
  5. ;
  6. ;        15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  7. ;        --------------------  ----------  -------------
  8. ;             year                month          day
  9. ;
  10. ;   Syntax:   todaysdate = sysdate();
  11. ;        unsigned int   todaysdate;
  12. ;
  13. ;------------------------------------------------------------------
  14.  
  15. INCLUDE  PROGSEG.H
  16.  
  17. PUBLIC   sysdate
  18. sysdate  PROC NEAR
  19.  
  20.     mov  ah,02ah
  21.     int  21h                 ; call dos to get the system date
  22.     mov  ax,cx
  23.     sub  ax,1980             ; get rid of DOS format year bias
  24.     mov  cl,4
  25.     shl  ax,cl               ; room for month
  26.     add  al,dh
  27.     mov  cl,5                ; shift count to make room for the day
  28.     shl  ax,cl
  29.     add  al,dl               ; drop in the day
  30.  
  31.     ret
  32.  
  33. sysdate  ENDP
  34. INCLUDE  ENDPSEG.H
  35. END      sysdate
  36.  
  37.  
  38.  
  39.  
  40.