home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Games / WHDLoad / Src / programs / WDate.asm < prev    next >
Assembly Source File  |  1999-05-06  |  2KB  |  101 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    WDate.asm
  3. ;  :Contents.    Create Date-String for $VER ... INCBIN
  4. ;  :Author.    Bert Jahn
  5. ;  :EMail.    jah@pub.th-zwickau.de
  6. ;  :Address.    Franz-Liszt-Straße 16, Rudolstadt, 07404, Germany
  7. ;  :History.    1.0 27-Feb-95
  8. ;        1.1 07.01.96 format changed (INT -> DOS)
  9. ;               1.2 05.05.99 format changed, time removed
  10. ;  :Copyright.    Public Domain
  11. ;  :Language.    68000 Assembler
  12. ;  :Translator.    Barfly V1.117
  13. ;---------------------------------------------------------------------------*
  14. ;####################################################################
  15.  
  16.     INCDIR    Includes:
  17.     INCLUDE    dos/datetime.i
  18.     INCLUDE    lvo/dos.i
  19.     INCLUDE lvo/exec.i
  20.  
  21.     INCLUDE    macros/ntypes.i
  22.     
  23.     NSTRUCTURE    globals,0
  24.         NSTRUCT    gl_datetime,dat_SIZEOF
  25.         NSTRUCT    gl_strtime,LEN_DATSTRING
  26.         NSTRUCT    gl_strdate,LEN_DATSTRING
  27.         NALIGNLONG
  28.         NLABEL  gl_SIZEOF
  29.         
  30. ;####################################################################
  31.  
  32.     PURE                ;set pure-bit
  33.         bra    .start
  34.         dc.b    "$VER: WDate 1.2 "
  35.     DOSCMD    "WDate >T:date"
  36.     INCBIN    "T:date"
  37.         dc.b    " by Bert Jahn"
  38.         dc.b    " (Create DateString for $VER using INCBIN)",0
  39.     EVEN
  40. .start
  41.         link    a5,#gl_SIZEOF        ;a5 = global vars
  42.         moveq    #37,d0
  43.         lea    (_dosname),a1
  44.         move.l    (4),a6
  45.         jsr    (_LVOOpenLibrary,a6)
  46.         tst.l    d0
  47.         beq    .quit
  48.         move.l    d0,a6            ;a6 = dosbase global !
  49.         
  50.         lea    (gl_datetime+dat_Stamp,a5),a0
  51.         move.l    a0,d1
  52.         jsr    (_LVODateStamp,a6)
  53.  
  54.         lea    (gl_datetime,a5),a0
  55.         move.b    #FORMAT_CDN,(dat_Format,a0)
  56.         clr.b    (dat_Flags,a0)
  57.         clr.l    (dat_StrDay,a0)
  58.         lea    (gl_strdate,a5),a1
  59.         move.l    a1,(dat_StrDate,a0)
  60.         lea    (gl_strtime,a5),a1
  61.         move.l    a1,(dat_StrTime,a0)
  62.         move.l    a0,d1
  63.         jsr    (_LVODateToStr,a6)
  64.         tst.l    d0
  65.         beq    .closedos
  66.         
  67.         lea    (gl_strdate,a5),a0
  68.         move.b    #".",(2,a0)
  69.         move.b    #".",(5,a0)
  70.         move.w    (6,a0),(8,a0)
  71.         move.w    #"19",(6,a0)
  72.         cmp.b    #"7",(8,a0)
  73.         bhs    .1
  74.         move.w    #"20",(6,a0)
  75. .1        clr.b    (10,a0)
  76.  
  77.         lea    (_outstr),a0
  78.         move.l    a0,d1
  79.         pea    (gl_strtime,a5)
  80.         pea    (gl_strdate,a5)
  81.         move.l    a7,d2
  82.         jsr    (_LVOVPrintf,a6)
  83.         addq.l    #8,a7
  84.  
  85. .closedos    move.l    a6,a1
  86.         move.l    (4),a6
  87.         jsr    (_LVOCloseLibrary,a6)
  88. .quit        unlk    a5
  89.         moveq    #0,d0
  90.         rts
  91.  
  92. ;####################################################################
  93.  
  94. _outstr        dc.b    "(%s)",0
  95. _dosname    dc.b    "dos.library",0
  96.  
  97. ;####################################################################
  98.  
  99.     END
  100.  
  101.