home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / FORTRAN / SUPERT87.ZIP / RMDATE.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-12-15  |  1.4 KB  |  76 lines

  1.         name    date
  2. ;
  3. ;
  4. ; subroutine date: assembly language routine to allow the acquisition
  5. ; of the current date
  6. ;
  7. ; fortran call is : call date(month,day,year) 
  8. ;
  9. ; where: month = munber of month(1-12), day = number of day(1-31)
  10. ;       year = current year(1980-2099)
  11. ;
  12. ;
  13. ;    interface to IBM professional fortran 1.0
  14.  
  15. stack_size    equ    6    ; number of bytes needed on stack
  16.  
  17. data        segment
  18.         db    'date    '
  19. sp_save    dw    ?
  20.         dd    date
  21.         dd    0
  22. data        ends
  23.  
  24.  
  25.  
  26. ;
  27. code        segment    'code'
  28.         assume    cs:code,ds:data,es:nothing,ss:nothing
  29.         public    date
  30. date        proc        far
  31.  
  32.  
  33. ;----------execute Profort standard entry linkage--------------------
  34.  
  35.         push    ds
  36.         sub    bp,stack_size+6
  37.         mov    ax,data
  38.         mov    ds,ax
  39.         mov    sp_save,sp
  40.         mov    sp,bp
  41. ;---------------------------------------------------------------------
  42.  
  43.         mov    ah,2ah
  44.         int    21h            ; get date
  45.  
  46. ;    es:[bx] =    &month
  47. ;    es:4[bx] =    &day
  48. ;    es:8[bx] =  &year
  49.  
  50. ;    format returned by dos is dh(month),dl(day),cx(year)
  51.  
  52.         lds    si,es:8[bx]
  53.         mov    [si],cx        ; store year
  54.         lds    si,es:[bx]
  55.         mov    al,dh
  56.         xor    ah,ah
  57.         mov    [si],ax        ; store month
  58.         mov    al,dl
  59.         lds    si,es:4[bx]
  60.         mov    [si],ax        ; store day
  61.  
  62. ;-------------perform exit linkage------------------------------------
  63.  
  64.         add    sp,stack_size+2
  65.         ret
  66. ;---------------------------------------------------------------------
  67.  
  68. date        endp
  69. code        ends
  70.         end
  71.  
  72. stack        segment word stack 'stack'
  73.         db    stack_size dup(?)
  74. stack        ends
  75.         end
  76.