home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / deskaccs / cal.arc / TIME.ASM < prev   
Assembly Source File  |  1987-01-25  |  792b  |  39 lines

  1. dgroup    group    data
  2. data    segment byte public 'DATA'
  3. data    ends
  4.  
  5. _prog    segment byte
  6.     assume cs:_prog,ds:dgroup
  7.  
  8. ; long time_bin()
  9. ;
  10. ; Function: return the current time as a long in binary format:
  11. ; top byte is hours (0-23), next is minutes (0-59), seconds (0-59),
  12. ; and hundreths (0-99).
  13. ;
  14.     public time_bin
  15. time_bin proc far
  16.     mov    ah,2Ch        ; get-time command
  17.     int    21h        ; BIOS request
  18.     mov    bx,dx        ; ss,hu
  19.     mov    ax,cx        ; hh,mm
  20.     ret
  21. time_bin endp
  22.  
  23. ; long date_bin()
  24. ;
  25. ; Function:  return the current date as a long: top two bytes are year,
  26. ; followed by month and day in last two bytes.
  27. ;
  28.     public date_bin
  29. date_bin proc far
  30.     mov    ah,2Ah        ; get-date command
  31.     int    21h        ; BIOS request
  32.     mov    bx,dx        ; year
  33.     mov    ax,cx        ; month and day
  34.     ret
  35. date_bin endp
  36.  
  37. _prog    ends
  38.     end
  39.