home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC6.DMS / in.adf / libsrc.lha / LIBSRC / tmpnam.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-16  |  982 b   |  66 lines

  1.  
  2. * Maxon C++ Projekt:
  3. * Library-Modul "tmpnam"
  4. * Jens Gelhar 25.10.91
  5.  
  6. execbase    = 4
  7.  
  8.     xdef    _tmpnam,tmpnam__Pc
  9.     xref    _DOSBase
  10.  
  11. _tmpnam:
  12. tmpnam__Pc:    movem.l d1/d2/a0/a1/a5/a6,-(a7)
  13.     move.l 6*4+4(a7),a5
  14.     move.l a5,d0
  15.     bne.b t0
  16.     lea buf,a5
  17.     move.l a5,6*4+4(a7)
  18. t0    lea tmpstr(pc),a0
  19. t1    move.b (a0)+,(a5)+
  20.     bne.b t1
  21.     subq.l #1,a5
  22.     move.l execbase.w,a0
  23.     move.l 276(a0),d0       ; ThisTask
  24.     moveq #7,d2
  25.     bsr.b tsub
  26.     addq.w #1,Count
  27.     move.w Count,d0
  28.     moveq #3,d2
  29.     bsr.b tsub
  30.     move.l _DOSBase,a6
  31.     move.l #bufbuf,d1
  32.     jsr -192(a6)            ; DateStamp
  33.     move.l bufbuf,d0
  34.     moveq #4,d2
  35.     bsr.b tsub
  36.     move.l bufbuf+4,d0
  37.     moveq #4,d2
  38.     bsr.b tsub
  39.     move.l bufbuf+8,d0
  40.     moveq #3,d2
  41.     bsr.b tsub
  42.     clr.b (a5)
  43.     movem.l (a7)+,d1/d2/a0/a1/a5/a6
  44.     move.l 4(a7),d0
  45.     rts
  46.  
  47. tsub    ; d0 in d2 "Ziffern" kodieren
  48.     move.b #'_',(a5)+
  49. tsL    moveq #15,d1
  50.     and.w d0,d1
  51.     add.b #'a',d1
  52.     move.b d1,(a5)+
  53.     lsr.l #4,d0
  54.     dbra d2,tsL
  55.     rts
  56.  
  57. tmpstr:    dc.b 't:TMP',0
  58.  
  59.     SECTION B,BSS
  60.  
  61. bufbuf:    blk.l 3
  62. Count:    blk.w 1
  63. buf:    blk.b 40
  64.  
  65.     end
  66.