home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d534 / term.lha / Term / Source.LZH / Format.asm < prev    next >
Assembly Source File  |  1991-07-06  |  3KB  |  159 lines

  1. * $Revision Header * Header built automatically - do not edit! *************
  2. *
  3. *    (C) Copyright 1990 by Olaf 'Olsen' Barthel & MXM
  4. *
  5. *    Name .....: Format.asm
  6. *    Created ..: Monday 21-Jan-91 20:12
  7. *    Revision .: 1
  8. *
  9. *    Date            Author          Comment
  10. *    =========       ========        ====================
  11. *    11-Apr-91       Olsen           Added atol.
  12. *    21-Jan-91       Olsen           Created this file!
  13. *
  14. * $Revision Header *********************************************************
  15.  
  16. CALL    macro
  17.     xref    _LVO\1
  18.     jsr    _LVO\1(a6)
  19.     endm
  20.  
  21.     csect    text,0,0,1,2
  22.  
  23. *--------------------------------------------------------------------------
  24. *
  25. *    This file contains some ANSI-`C' style routines which are not
  26. *    directly implemented through dos.library or utility.library.
  27. *
  28. *--------------------------------------------------------------------------
  29.  
  30.     xdef    _Printf
  31.     xdef    _FPrintf
  32.  
  33.     xdef    _SPrintf
  34.     xdef    _VSPrintf
  35.  
  36.     xdef    _atol
  37.  
  38. *--------------------------------------------------------------------------
  39.  
  40. _Printf:
  41.     movem.l    d2/a6,-(sp)
  42.  
  43.     move.l    12(sp),d1
  44.     lea    16(sp),a0
  45.     move.l    a0,d2
  46.  
  47.     move.l    _DOSBase(a4),a6
  48.  
  49.     CALL    VPrintf
  50.  
  51.     movem.l    (sp)+,d2/a6
  52.     rts
  53.  
  54. *--------------------------------------------------------------------------
  55.  
  56. _FPrintf:
  57.     movem.l    d2/d3/a6,-(sp)
  58.  
  59.     move.l    16(sp),d1
  60.     move.l    20(sp),d2
  61.     lea    24(sp),a0
  62.     move.l    a0,d3
  63.  
  64.     move.l    _DOSBase(a4),a6
  65.  
  66.     CALL    VFPrintf
  67.  
  68.     movem.l    (sp)+,d2/d3/a6
  69.     rts
  70.  
  71. *--------------------------------------------------------------------------
  72.  
  73. _SPrintf:
  74.     movem.l    a2/a3/a6,-(sp)
  75.  
  76.     move.l     4+12(sp),a3
  77.     move.l     8+12(sp),a0
  78.     lea    12+12(sp),a1
  79.     lea    stuffchar(pc),a2
  80.  
  81.     move.l    4,a6
  82.     CALL    RawDoFmt
  83.  
  84.     movem.l    (sp)+,a2/a3/a6
  85.  
  86.     rts
  87.  
  88. *--------------------------------------------------------------------------
  89.  
  90. _VSPrintf:
  91.     movem.l    a2/a3/a6,-(sp)
  92.  
  93.     move.l     4+12(sp),a3
  94.     move.l     8+12(sp),a0
  95.     move.l    12+12(sp),a1
  96.     lea    stuffchar(pc),a2
  97.  
  98.     move.l    4,a6
  99.     CALL    RawDoFmt
  100.  
  101.     movem.l    (sp)+,a2/a3/a6
  102.  
  103.     rts
  104.  
  105. stuffchar:
  106.     move.b    d0,(a3)+
  107.     rts
  108.  
  109. *--------------------------------------------------------------------------
  110. *
  111. *    A tiny replacement for atol(), implemented through StrToLong.
  112. *
  113. *--------------------------------------------------------------------------
  114.  
  115. _atol:    move.l    4(sp),d1
  116.  
  117.     move.l    d2,-(sp)
  118.     move.l    a6,-(sp)
  119.  
  120.     pea.l    0
  121.  
  122.     lea.l    (sp),a0
  123.     move.l    a0,d2
  124.  
  125.     move.l    _DOSBase(a4),a6
  126.  
  127.     CALL    StrToLong
  128.  
  129.     move.l    (sp),d0
  130.  
  131.     add.w    #4,sp
  132.     move.l    (sp)+,a6
  133.     move.l    (sp)+,d2
  134.  
  135.     rts
  136.  
  137. *--------------------------------------------------------------------------
  138. *
  139. *    These two lines are actually to make BLINK believe that some kind
  140. *    of startup code will clear the Data/BSS segment before running the
  141. *    main program. Since this is no longer necessary with Kickstart 2.x
  142. *    these two lines save about 34 KBytes of disk space.
  143. *
  144. *--------------------------------------------------------------------------
  145.  
  146.     lea    __BSSBAS,a0
  147.     move.l    #__BSSLEN,d0
  148.  
  149. *--------------------------------------------------------------------------
  150.  
  151.     csect    __MERGED
  152.  
  153.     xref    _DOSBase
  154.  
  155.     xref    __BSSBAS
  156.     xref    __BSSLEN
  157.  
  158.     end
  159.