home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1997 #3 / amigamamagazinepolishissue03-1 / polski_aminet / michal_letowski / debuglib / src / kputstr.a < prev    next >
Text File  |  1996-05-11  |  1KB  |  74 lines

  1. ;    kputstr.a - KPutStr implementation using ROM routines
  2. ;    $VER: kputstr.a 37.1 (10.5.96)
  3. ;    Copyright © 1996 Michael Letowski
  4. ;
  5. ;    37.1 (10.5.96) - initial version
  6.  
  7.     include    "exec/funcdef.i"
  8.     include    "exec/exec_lib.i"
  9.  
  10.     xdef    _KPutStr
  11.     xdef    @KPutStr
  12.  
  13. ; Some aliases
  14.  
  15.     xdef    _kputs
  16.     xdef    @kputs
  17.     xdef    KPutStr
  18.  
  19.     section    text,code
  20.  
  21.  
  22. ******* debug.lib/KPutStr ***************************************************
  23. *
  24. *   NAME
  25. *       KPutStr -- put a string to the debugging console. (V37)
  26. *
  27. *   SYNOPSIS
  28. *       KPutStr(string)
  29. *               A0
  30. *
  31. *       VOID KPutStr(STRPTR);
  32. *
  33. *   FUNCTION
  34. *       Puts a NULL-terminated string to debugging console (defaults to the
  35. *       serial port at 9600 baud). This function will not return until the
  36. *       string has been completely transmitted.
  37. *
  38. *   INPUTS
  39. *       string - a string to be outputted.
  40. *
  41. *   NOTES
  42. *       @KPutStr, @kputs and KPutStr are identical assembly interfaces that
  43. *       expect a string pointer to be in A0 register. _KPutStr, _kputs are the
  44. *       C interfaces that expect a string pointer to be a longword on stack.
  45. *
  46. *   SEE ALSO
  47. *       KPutChar(), KPrintf().
  48. *
  49. *****************************************************************************
  50. *
  51. * _KPutStr(string)
  52. * @KPutStr(R_A0 string)
  53. *
  54. _KPutStr:
  55. _kputs:
  56.     move.l    4(sp),a0
  57.  
  58. @KPutStr:
  59. @kputs:
  60. KPutStr:
  61.     move.l    a6,-(sp)
  62.     move.l    (4).w,a6
  63.  
  64. KPSLoop:
  65.     move.b    (a0)+,d0
  66.     beq    KPSExit
  67.     jsr    _LVORawPutChar(a6)
  68.     bra    KPSLoop
  69. KPSExit:
  70.     move.l    (sp)+,a6
  71.     rts
  72.  
  73.     end
  74.