home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / newgccstart.lha / source.lha / libm / alib.c next >
Encoding:
C/C++ Source or Header  |  1994-03-14  |  664 b   |  25 lines

  1. #ifdef __GNUC__
  2. #include <stdarg.h>
  3. #include <exec/devices.h>
  4. #include <exec/io.h>
  5. #include <inline/exec.h>
  6. #include "libcall.h"
  7.  
  8. extern void writeone(void);
  9.  
  10. asm("  .text        ;" /* Oh, dear. I can't do this in C */
  11.     "  .even        ;"
  12.     "_writeone:     ;"
  13.     "  moveb d0,a3@+;"
  14.     "  rts           ");
  15.  
  16. void sprintf(STRPTR buffer,STRPTR fmt,...)
  17. { RawDoFmt(fmt,(ULONG *)&fmt+1,writeone,buffer); } /* Not very clean, but ... */
  18.  
  19. void BeginIO(struct IORequest *iorequest)
  20. { register struct IORequest *a1 asm("a1")=iorequest;
  21.   register struct Device    *a6 asm("a6")=iorequest->io_Device;
  22.   asm(CALL("-30")::"r"(a1),"r"(a6):"a0","a1","d0","d1");
  23. }
  24. #endif
  25.