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

  1. ;    kputchar.a - KPutChar implementation using ROM routines
  2. ;    $VER: kputchar.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    _KPutChar
  11.     xdef    @KPutChar
  12.  
  13. ; Some aliases
  14.  
  15.     xdef    _kputc
  16.     xdef    @kputc
  17.     xdef    KPutChar
  18.  
  19.     section    text,code
  20.  
  21.  
  22. ******* debug.lib/KPutChar **************************************************
  23. *
  24. *   NAME
  25. *       KPutChar -- put a character to the debugging console. (V37)
  26. *
  27. *   SYNOPSIS
  28. *       char = KPutChar(char)
  29. *       D0              D0
  30. *
  31. *       LONG KPutChar(LONG);
  32. *
  33. *   FUNCTION
  34. *       Puts a character to the debugging console (defaults to the serial
  35. *       port at 9600 baud). This function will not return until the
  36. *       character has been completely transmitted.
  37. *
  38. *   INPUTS
  39. *       char - a char to be outputted.
  40. *
  41. *   RESULT
  42. *       char - a character that was outputted.
  43. *
  44. *   NOTES
  45. *       @KPutChar, @kputc and KPutChar are identical assembly interfaces that
  46. *       expect character in D0 register. _KPutChar, _kputc are the C
  47. *       interfaces that expect a character to be a longword on stack.
  48. *
  49. *****************************************************************************
  50. *
  51. * _KPutChar(char)
  52. * @KPutChar(R_D0 char)
  53. *
  54. _KPutChar:
  55. _kputc:
  56.     move.l    4(sp),d0
  57.  
  58. @KPutChar:
  59. @kputc:
  60. KPutChar:
  61.     move.l    a6,-(sp)
  62.     move.l    (4).w,a6
  63.     jsr    _LVORawPutChar(a6)
  64.     move.l    (sp)+,a6
  65.     rts
  66.  
  67.     end
  68.